---
schema_version: "1"
id: 98ce28e07fd410b4c1c7738de8757af3ff22a0309b4d4bd16d7e939024d5ecf5
title: Get Service Appointments Assigned to the Dummy Resource
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/build-custom-apps/usecase11/uc11-get-service-appointments.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc11-get-service-appointments.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 695066c637e7382a93fb80b8d4a82627f70b6129204879faaf471a4aeda4e94f
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Get Service Appointments Assigned to the Dummy Resource

Show your users the service appointments—appointments booked through Salesforce Scheduler—scheduled against the dummy resource by retrieving the list of service appointments. Branch managers or administrators can reassign the appointments to the actual resources.

For the list of AppointmentInvitation object fields, see [ServiceAppointment](https://developer.salesforce.com/docs/atlas.en-us.salesforce_scheduler_developer_guide.meta/salesforce_scheduler_developer_guide/sforce_api_objects_serviceappointment.htm).

1.  Create a page to show the service appointments scheduled against the dummy resource.

2.  To retrieve the list of service appointments, make a [`Query()`](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm) request on the ServiceAppointment object.

    -   To choose additional columns from the ServiceAppointment object, such as lead and parent record IDs, modify the query.
    -   To see upcoming appointments first, sort appointments by start time ascending.
    -   To avoid past appointments, add *where currentTime is greater than start time*.
    **Sample REST API Request**

    ```nolang
    https://YOUR_INSTANCE.salesforce.com//services/data/v68.0/query/?q=​SELECT+ServiceAppointmentId,ServiceResourceId,ServiceAppointment.SchedEndTime,ServiceAppointment.SchedStartTime,ServiceAppointment.ServiceTerritoryId,ServiceAppointment.Id+​FROM+AssignedResource+WHERE+ServiceResourceId+=+'0HnS70000004EFyKAM'+ORDER+BY+createdDate+DESC+limit+5
    ```

    Where `YOUR_INSTANCE` is a variable.

    **Sample Response**

    ```nolang
    {
      "totalSize": 5,
      "done": true,
      "records": [
        {
          "attributes": {
            "type": "AssignedResource",
            "url": "/services/data/v56.0/sobjects/AssignedResource/03rS70000000401IAA"
          },
          "ServiceAppointmentId": "08pS70000000CxOIAU",
          "ServiceResourceId": "0HnS70000004EFyKAM",
          "ServiceAppointment": {
            "attributes": {
              "type": "ServiceAppointment",
              "url": "/services/data/v56.0/sobjects/ServiceAppointment/08pS70000000CxOIAU"
            },
            "SchedEndTime": "2022-10-03T17:00:00.000+0000",
            "SchedStartTime": "2022-10-03T16:30:00.000+0000",
            "ServiceTerritoryId": "0HhS70000004F9zKAE",
            "Id": "08pS70000000CxOIAU"
          }
        },
        {
          "attributes": {
            "type": "AssignedResource",
            "url": "/services/data/v56.0/sobjects/AssignedResource/03rS700000003zwIAA"
          },
          "ServiceAppointmentId": "08pS70000000CxJIAU",
          "ServiceResourceId": "0HnS70000004EFyKAM",
          "ServiceAppointment": {
            "attributes": {
              "type": "ServiceAppointment",
              "url": "/services/data/v56.0/sobjects/ServiceAppointment/08pS70000000CxJIAU"
            },
            "SchedEndTime": "2022-10-03T17:00:00.000+0000",
            "SchedStartTime": "2022-10-03T16:30:00.000+0000",
            "ServiceTerritoryId": "0HhS70000004F9zKAE",
            "Id": "08pS70000000CxJIAU"
          }
        },
        {
          "attributes": {
            "type": "AssignedResource",
            "url": "/services/data/v56.0/sobjects/AssignedResource/03rS700000003zrIAA"
          },
          "ServiceAppointmentId": "08pS70000000CxEIAU",
          "ServiceResourceId": "0HnS70000004EFyKAM",
          "ServiceAppointment": {
            "attributes": {
              "type": "ServiceAppointment",
              "url": "/services/data/v56.0/sobjects/ServiceAppointment/08pS70000000CxEIAU"
            },
            "SchedEndTime": "2022-10-03T17:00:00.000+0000",
            "SchedStartTime": "2022-10-03T16:30:00.000+0000",
            "ServiceTerritoryId": "0HhS70000004F9zKAE",
            "Id": "08pS70000000CxEIAU"
          }
        },
        {
          "attributes": {
            "type": "AssignedResource",
            "url": "/services/data/v56.0/sobjects/AssignedResource/03rS70000004D3WIAU"
          },
          "ServiceAppointmentId": "08pS70000004F3xIAE",
          "ServiceResourceId": "0HnS70000004EFyKAM",
          "ServiceAppointment": {
            "attributes": {
              "type": "ServiceAppointment",
              "url": "/services/data/v56.0/sobjects/ServiceAppointment/08pS70000004F3xIAE"
            },
            "SchedEndTime": "2022-10-03T17:00:00.000+0000",
            "SchedStartTime": "2022-10-03T16:30:00.000+0000",
            "ServiceTerritoryId": "0HhS70000004F9zKAE",
            "Id": "08pS70000004F3xIAE"
          }
        },
        {
          "attributes": {
            "type": "AssignedResource",
            "url": "/services/data/v56.0/sobjects/AssignedResource/03rS700000003zmIAA"
          },
          "ServiceAppointmentId": "08pS70000000Cx9IAE",
          "ServiceResourceId": "0HnS70000004EFyKAM",
          "ServiceAppointment": {
            "attributes": {
              "type": "ServiceAppointment",
              "url": "/services/data/v56.0/sobjects/ServiceAppointment/08pS70000000Cx9IAE"
            },
            "SchedEndTime": "2022-10-03T17:00:00.000+0000",
            "SchedStartTime": "2022-10-03T16:30:00.000+0000",
            "ServiceTerritoryId": "0HhS70000004F9zKAE",
            "Id": "08pS70000000Cx9IAE"
          }
        }
      ]
    }
    ```

3.  Parse the JSON response, and show the service appointments on a page that you created. Branch managers or administrators can reassign the appointments to the actual resources.


