Get Dummy Service Resource

Show your users the dummy resource and its availability based on the selected work type group and service territory.

  1. Create a page to show your users dummy service resources.

  2. Make a POST request on the getAppointmentCandidates REST API by passing the required workTypeGroupId and territoryIds parameters. Set allowConcurrentScheduling to true to get concurrent time slots for the dummy resource.

    note: Specify the operating hour scheduling policy ID to show only the dummy resource who’s defined with operating hours for concurrent scheduling. See Configure Scheduling Policy to Enforce Operating Hours.

    Resource URI

    https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/scheduling/getAppointmentCandidates
    

    Where YOUR_INSTANCE is a variable.

    Sample Request

    {
      "startTime": "2022-10-01T00:00:00.000Z",
      "endTime": "2022-10-08T20:00:00.000Z",
      "allowConcurrentScheduling": true,
      "schedulingPolicyId": "0VrS7000000004XKAQ",
      "filterByResources": [
        "0HnS70000004EFyKAM"
      ],
      "workTypeGroupId": "0VSS70000004DvWOAU",
      "territoryIds": [
        "0HhS70000004F9zKAE"
      ]
    }
    

    Sample Response

    The API returns the service resources and available time slots.

    {
      "candidates": [
        {
          "endTime": "2022-10-03T16:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T16:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T17:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T16:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T17:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T17:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T18:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T17:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T18:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T18:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T19:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T18:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T19:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T19:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T20:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T19:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T20:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T20:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T21:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T20:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T21:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T21:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T22:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T21:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T22:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T22:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T23:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T22:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-03T23:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T23:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T00:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-03T23:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T00:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T00:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T01:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T00:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T01:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T01:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T02:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T01:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T02:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T02:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T03:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T02:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T03:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T03:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T04:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T03:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T16:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T16:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T17:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T16:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T17:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T17:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T18:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T17:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T18:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T18:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T19:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T18:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T19:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T19:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T20:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T19:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T20:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T20:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T21:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T20:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T21:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T21:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T22:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T21:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T22:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T22:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T23:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T22:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-04T23:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T23:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T00:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-04T23:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T00:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T00:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T01:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T00:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T01:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T01:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T02:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T01:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T02:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T02:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T03:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T02:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T03:30:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T03:00:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        },
        {
          "endTime": "2022-10-05T04:00:00.000+0000",
          "resources": [
            "0HnS70000004EFyKAM"
          ],
          "startTime": "2022-10-05T03:30:00.000+0000",
          "territoryId": "0HhS70000004F9zKAE"
        }
      ]
    }
    
  3. Parse the JSON response, and show the dummy resource on a page that you created. Your users can select the dummy resource for the appointment.

On the next page, you can show the appointment details for the user to review and create the appointment.