Update Service Appointments

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

1https://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.

1{
2    
3    "serviceAppointmentId": "08pB0000000aKf2IAE",
4    "serviceAppointment": {
5      "schedStartTime": "2021-10-25T17:30:00.000+0000",
6      "schedEndTime": "2021-10-25T18:30:00.000+0000",
7      "serviceTerritoryId": "0HhB0000000TaHOKA0"
8    },
9    "assignedResources": [
10      {
11        "serviceResourceId": "0HnB0000000TavDKAS",
12        "isRequiredResource": true
13      }
14    ]
15  }

Sample Response

The API returns the service appointment ID and the assigned service resources.

1{
2    "result" : {
3      "assignedResourceIds" : [ "03rB0000000cBVxIAM" ],
4      "serviceAppointmentId" : "08pB0000000aKf2IAE"
5    }
6  }

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.