A service appointment represents an appointment that is booked via Salesforce Scheduler. To update the appointment, run a PATCH request on the service-appointments Connect API.
Ensure that you make a note of the service appointment IDs that you retrieved in the previous task.
Update service appointments to use new resources by using PATCH requests on the service-appointments Connect API. Pass the serviceResourceId and serviceAppointmentId parameters with each request.
Resource URI
https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/connect/scheduling/service-appointments
Where YOUR_INSTANCE is a variable.
Sample Request
In the input request body, pass the service appointment ID as serviceAppointmentId and service resource ID as serviceResourceId.
{
"serviceAppointmentId": "08pB0000000aKf2IAE",
"serviceAppointment": {
"schedStartTime": "2021-10-25T17:30:00.000+0000",
"schedEndTime": "2021-10-25T18:30:00.000+0000",
"serviceTerritoryId": "0HhB0000000TaHOKA0"
},
"assignedResources": [
{
"serviceResourceId": "0HnB0000000TavDKAS",
"isRequiredResource": true
}
]
}
Sample Response
The API returns the service appointment ID and the assigned service resources.
{
"result" : {
"assignedResourceIds" : [ "03rB0000000cBVxIAM" ],
"serviceAppointmentId" : "08pB0000000aKf2IAE"
}
}
The request modifies the service appointment with a new service resource.
Run the PATCH request for each service appointment ID that needs you want to modify.