Service Modules > Scheduling and Optimization > Service Board > Max for Developers > Appendix C: Service Board Extension Package API
Appendix C: Service Board Extension Package API
Use these APIs to integrate Salesforce with the Service Board application.
REST API Endpoints
Send Transaction Data to Salesforce
The request body for the following endpoints is a JSON representation of the transaction data that is sent to Salesforce.
Method
POST
URL
https:<instance_url>/services/apexrest/SVMXSB/integration/txdata
Parameters
Response Content Type
application/json
Create Record
Section
Description
payload
Payload sent to Salesforce for record creation. Includes the Salesforce object API name, Salesforce fields value and previous fields value.
io_uuid
ID of the Service Board record.
eventName
Platform event type.
Example Request Body
{
"payload":
{
"objectName":
"SVMXC__SVMX_Event__c","fields":
{
"SVMXC__ActivityDateTime__c":"2023-12-22 21:32:00",
"SVMXC__SM_Integration_Source__c":"Remote",
"SVMXC__EndDateTime__c":"2023-12-23 13:29:00",
"SVMXC__Technician__c":"a1a2E000002zWgpQAE",
"SVMXC__Driving_Time_Home__c":"389",
"SVMXC__Description__c":null,
"SVMXC__SM_Appointment_Status__c":"Pending",
"SVMXC__StartDateTime__c":"2023-12-22 21:32:00",
"SVMXC__Location__c":null,"Name":"[WO-00010889] Princess Margaret Hospital Windsor",
"SVMXC__Service_Order__c":"a1gHu00000AJC9TIAX",
"SVMXC__WhatId__c":"a1gHu00000AJC9TIAX",
"SVMXC__Driving_Time__c":"388",
"OwnerId":"0052E00000IFi51QAD",
"SVMXC__SM_Longitude__c":"-0.609801",
"SVMXC__ActivityDate__c":"2023-12-22 21:32:00",
"SVMXC__SM_Latitude__c":"51.473944",
"SVMXC__SM_Version_Number__c":0
},
"io_uuid":"aaadc87d-63ad-400c-b341-966711c588d1"
},
"eventName":"create_event"
}
Update Record
Section
Description
payload
Payload sent to Salesforce for record updates. Includes the Salesforce object API name, Salesforce record ID, Salesforce fields value and previous fields value.
eventName
Platform event type.
Example Request Body
{
"payload":
{
"criteria":
{
"Id":"a1gHu00000AJCdhIAH"
},
"objectName":"SVMXC__Service_Order__c",
"fields":
{
"SVMXC__Group_Member__c":null,
"SVMXC__SM_Scheduled_Duration__c":null,
"SVMXC__Service_Group__c":null,
"SVMXC__SM_Lock_Appointment_Schedule__c":null,
"SVMXC__Scheduled_Date_Time__c":null,
"SVMXC__SM_Life_Cycle_Status__c":"New",
"SVMXC__SM_Version_Number__c":1,
"SVMXC__Locked_By_DC__c":false
},
"fields_previous":
{
"SVMXC__Group_Member__c":"a1a2E000002zWgrQAE",
"SVMXC__SM_Scheduled_Duration__c":"120",
"SVMXC__Service_Group__c":"a1e2E0000027UrXQAU",
"SVMXC__SM_Lock_Appointment_Schedule__c":"Lock in place",
"SVMXC__Scheduled_Date_Time__c":"2020-02-26 07:00:00",
"SVMXC__SM_Life_Cycle_Status__c":"Dispatched",
"SVMXC__SM_Version_Number__c":1,
"SVMXC__Locked_By_DC__c":true
}
},
"eventName":"update_wo"
}
Delete Record
Section
Description
payload
Payload sent to Salesforce for record deletion. Includes the Salesforce object API name and Salesforce record ID.
eventName
Platform event type.
Example Request Body
{
"payload":
{
"criteria":
{
"Id":"a0AHu00001LqFrGMAV"
},
"objectName":"SVMXC__SVMX_Event__c"
},
"eventName":"remove_event"
}
Example Response (Status Code 200) for Event Object
The response is a JSON representation of the results of the REST API call.
{"status":"Success","retVal":"a0AHu00001LqGkGMAV","errorLog":null}
Get Record
The request body for this endpoint is a JSON representation of the condition sent to Salesforce.
Method
POST
URL
https:<instance_url>/services/apexrest/SVMXSB/integration/v1/getRecord
Parameters
Response Content Type
application/json
Request Body Parameters
Parameter
Description
object_name
Salesforce API name of the object related to the record to be retrieved.
record_id
Salesforce record ID of the target record.
Example Request Body
{
"object_name": "SVMXC__Service_Order__c",
"record_id": "a1gHu00000AJCdmIAH"
}
Example Response (Status Code 200)
The response is a JSON representation of the results of the REST API call.
{
attributes
={
type=SVMXC__Service_Order__c,
url=/services/data/v59.0/sobjects/SVMXC__Service_Order__c/a1gHu00000AJCdmIAH},
Id=a1gHu00000AJCdmIAH, CurrencyIsoCode=USD,
SVMXC__SM_Integration_Source__c=Local,
...,
CreatedDate=2023-12-15T07:49:38.000+0000,
CreatedById=0052E00000IAvDXQA1,
LastModifiedDate=2023-12-15T07:50:00.000+0000,
LastModifiedById=0052E00000IAvDXQA1
}
Delete Salesforce Outbound Queue Records
The request body for this endpoint is a JSON representation of the delete condition sent to Salesforce.
Method
POST
URL
https:<instance_url>/services/apexrest/SVMXSB/integration/v1/deleteOutboundQueueRecords
Parameters
Response Content Type
application/json
Request Body Parameters
Parameter
Description
number_of_days
Number of days for which to retain Outbound Queue records. Records that have creation dates which do not fall within this period and Status values that match the specified status value in the payload are deleted.
status
Status values of the Outbound Queue records to be deleted. Multiple comma-separated values can be specified.
Example Request Body
{
"number_of_days": "6",
"status": "Published,Completed,Retried"
}
Example Response (Status Code 200)
The response is a JSON representation of the results of the REST API call.
{"deleted_success":"100","deleted_failed":"0"}
Delete Service Board Inbound Queue Records
The request body for this endpoint is a JSON representation of the delete condition sent to Salesforce.
Method
POST
URL
https:<instance_url>/services/apexrest/SVMXSB/integration/v1/deleteInboundQueueRecords
Parameters
Response Content Type
application/json
Request Body Parameters
Parameter
Description
number_of_days
Number of days for which to retain Inbound Queue records. Records that have creation dates which do not fall within this period and Status values that match the specified status value in the payload are deleted.
status
Status values of the Inbound Queue records to be deleted. Multiple comma-separated values can be specified.
Example Request Body
{
"number_of_days": "6",
"status": "Queued"
}
Example Response (Status Code 200)
The response is a JSON representation of the results of the REST API call.
{"deleted_success":"100","deleted_failed":"0"}
Get SVMXC and SVMXSB Package Versions
The request body for this endpoint is a JSON representation of the delete condition sent to Salesforce.
Method
GET
URL
https:<instance_url>/services/apexrest/SVMXSB/integration/v1/deleteInboundQueueRecords
Parameters
Response Content Type
application/json
Example Response (Status Code 200)
The response is a JSON representation of the SVMXC and SVMXSB package versions currently implemented on the instance.
{"VERSION_SVMXC":"23.10000","VERSION_SVMXSB":"23.10000"}
Apex API
Prepare and Publish Platform Events
global static void preparePlatformEvent(List<ProcessBuilderParams> params)
Data Structure
global class ProcessBuilderParams{
@InvocableVariable(label = 'Object Name' required=true)
global String objectName;

@InvocableVariable(label = 'Record Id' required=true)
global String recordId;

@InvocableVariable(label = 'Event Name' required=true)
global String eventName;
}
Parameters
Name
Type
Validation
Description
objectName
String
Required
Salesforce object API name.
recordId
String
Required
ID of the record for which the platform event is to be created.
eventName
String
Required
Platform event type.
Example Code
SVMXSB.SB_ProcessBuilderHelper.ProcessBuilderParams params = new SVMXSB.SB_ProcessBuilderHelper.ProcessBuilderParams();
params.objectName = 'SVMXC__Service_Order__c';
params.recordId = trigger.new[0].Id;
params.eventName = 'update_job';

lstParams.add(params);
SVMXSB.SB_ProcessBuilderHelper.preparePlatformEvent(lstParams);
Set modifiedFields Section Values in Work Order Platform Event Payload
* 
This function is available only for Service Board tenants with Service Board Extension release version packages SVMXSB 24.1 and later.
global static void createCollectionOfModifiedFields(String objectName, SObject oldSObject, SObject newSObject)
Parameters
Name
Type
Validation
Description
objectName
String
Required
Salesforce object API name.
oldSObject
SObject
Required
The Work Order record before the update.
newSObject
SObject
Required
The Work Order record after the update.
Example Code
SVMXSB.SB_ProcessBuilderHelper.createCollectionOfModifiedFields('SVMXC__Service_Order__c', trigger.old[0], trigger.new[0]);
Was this helpful?