Get Service Appointment Details

A service appointment represents an appointment that’s booked via Salesforce Scheduler. Use a GET method to fetch the details of a service appointment record.

This task helps you retrieve additional details of each service appointment that you listed in the previous task.

Sample Request

Here’s a sample GET request to retrieve the details of a service appointment.

1https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/query/?q=SELECT+Id,SchedEndTime,SchedStartTime,ServiceTerritoryId,WorkTypeId+FROM+ServiceAppointment+WHERE+id+=+'08pB0000000aKf2IAE'

Where YOUR_INSTANCE is a variable.

Sample Response

The request returns the details of an anonymous service appointment.

1{
2  "totalSize": 1,
3  "done": true,
4  "records": [
5    {
6      "attributes": {
7        "type": "ServiceAppointment",
8        "url": "/services/data/v53.0/sobjects/ServiceAppointment/08pB0000000aKf2IAE"
9      },
10      "Id": "08pB0000000aKf2IAE",
11      "SchedEndTime": "2021-10-25T18:30:00.000+0000",
12      "SchedStartTime": "2021-10-25T17:30:00.000+0000",
13      "ServiceTerritoryId": "0HhB0000000TaHOKA0",
14      "WorkTypeId": "08qB0000000UF63IAG"
15    }
16  ]
17}

Use a collection object to capture all the details of service appointments.