---
schema_version: "1"
id: 1db38a35bf100aca1ea20d33a11bd88588b7677aa5a763e7a132f08e0d90cdda
title: Get Service Appointments
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/uc5-get-service-appointments.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc5-get-service-appointments.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6e0df4f266d20898e07baee0b858009def5be0843c008f526ab8457461a9d307
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Get Service Appointments

The `AssignedResource` object represents a service resource who is assigned to a service appointment in Salesforce Scheduler. Retrieve service appointment IDs of all scheduled appointments associated with specific resources by using the `query` request on the `AssignedResource` object.

**Sample Request**

This sample REST API call uses the `query` request to retrieve the anonymous service appointments that are associated with unavailable resources.

```nolang
https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/query/?q=SELECT+ServiceAppointmentId,ServiceResourceId+FROM+AssignedResource+WHERE+ServiceResourceId+=+'SERVICE_RESOURCE_ID'+AND+ServiceAppointment.IsAnonymousBooking+=+TRUE
```

Where `YOUR_INSTANCE` and `SERVICE_RESOURCE_ID` are variables.

For more information, see [Execute a SOQL Query](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm). Ensure that the filter falls within the query limits.

**Sample Response**

The method retrieves the list of anonymous appointments that are associated with specific resources.

```nolang
{
  "totalSize" : 2,
  "done" : true,
  "records" : [ 
    {
      "attributes" : {
        "type" : "AssignedResource",
        "url" : "/services/data/v53.0/sobjects/AssignedResource/03rB0000000cBVOIA2"
      },
      "ServiceAppointmentId" : "08pB0000000aKeYIAU",
      "ServiceResourceId" : "0HnB0000000Tav3KAC"
    }, 
    {
      "attributes" : {
        "type" : "AssignedResource",
        "url" : "/services/data/v53.0/sobjects/AssignedResource/03rB0000000cBVsIAM"
      },
      "ServiceAppointmentId" : "08pB0000000aKf2IAE",
      "ServiceResourceId" : "0HnB0000000Tav3KAC"
    } 
 ]
}
```

Use a `collection` object to capture all appointment IDs that the GET request retrieved. If you call multiple GET requests, include in the `collection` object the appointment IDs that each request returned.. This task helps you create a list of service appointments that you must update with new resources.

