Get Service Appointment Details
A service appointment represents an appointment booked through Salesforce Scheduler. Use the GET method on the Service Appointment object to fetch the details of a service appointment record.
Create a page where you can show the details of a multi-resource service appointment record that the user selects.
Sample Request
Here’s a sample GET request to retrieve the service appointment details.
1https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/query/?q=SELECT+Id,SchedEndTime,SchedStartTime,ServiceTerritoryId,WorkTypeId+FROM+ServiceAppointment+WHERE+id+=+'08pB0000000aJKhIAM'
Where YOUR_INSTANCE is a variable.
Sample Response
The method returns the service appointment details.
1{
2 "totalSize" : 1,
3 "done" : true,
4 "records" : [ {
5 "attributes" : {
6 "type" : "ServiceAppointment",
7 "url" : "/services/data/v53.0/sobjects/ServiceAppointment/08pB0000000aKf7IAE"
8 },
9 "Id" : "08pB0000000aKf7IAE",
10 "SchedEndTime" : "2021-10-22T15:45:00.000+0000",
11 "SchedStartTime" : "2021-10-22T15:00:00.000+0000",
12 "ServiceTerritoryId" : "0HhB0000000TakhKAC",
13 "WorkTypeId" : "08qB0000000Tf1FIAS"
14 } ]
15}
Parse the JSON response, and display the service appointments details on a page so that the user can change the multi-resource service appointment as needed.
On the next page, you can show the user an option to select a different service resource of an existing multi-resource appointment.