Get Actual Service Resources

Retrieve the actual service resources—an employee from your company, such as a loan officer, investment advisor, doctor, nurse practitioner, or retail store specialist who attends appointments with clients—based on the work type group and service territory that’s assigned to a service appointment. Business managers or administrators can then assign an available service resource to an appointment.

  1. Make a POST request on the getAppointmentCandidates REST API by passing the required workTypeGroupId and territoryIds parameters.

    Specify the shift’s scheduling policy ID to show only the actual resources who have set regular working hours with shifts. For more information, see Configure Scheduling Policy to Enforce Shifts.

    Note

    Resource URI

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

    Where YOUR_INSTANCE is a variable.

    Sample Request

    1{
    2  "startTime": "2022-10-01T17:00:00.000+0000",
    3  "endTime": "2022-10-08T18:00:00.000+0000",
    4  "workTypeGroupId": "0VSS70000004DvWOAU",
    5  "schedulingPolicyId": "0VrS70000004CEhKAM",
    6  "territoryIds": [
    7    "0HhS70000004F9zKAE"
    8  ]
    9}

    Sample Response

    The API returns the service resources available for the specified time slots.

    1{
    2  "candidates": [
    3    {
    4      "endTime": "2022-10-01T17:30:00.000+0000",
    5      "resources": [
    6        "0HnS700000007xwKAA"
    7      ],
    8      "startTime": "2022-10-01T17:00:00.000+0000",
    9      "territoryId": "0HhS70000004F9zKAE"
    10    },
    11    {
    12      "endTime": "2022-10-01T18:00:00.000+0000",
    13      "resources": [
    14        "0HnS700000007xwKAA"
    15      ],
    16      "startTime": "2022-10-01T17:30:00.000+0000",
    17      "territoryId": "0HhS70000004F9zKAE"
    18    },
    19    {
    20      "endTime": "2022-10-01T18:30:00.000+0000",
    21      "resources": [
    22        "0HnS700000007xwKAA"
    23      ],
    24      "startTime": "2022-10-01T18:00:00.000+0000",
    25      "territoryId": "0HhS70000004F9zKAE"
    26    },
    27    {
    28      "endTime": "2022-10-01T19:00:00.000+0000",
    29      "resources": [
    30        "0HnS700000007xwKAA"
    31      ],
    32      "startTime": "2022-10-01T18:30:00.000+0000",
    33      "territoryId": "0HhS70000004F9zKAE"
    34    },
    35    {
    36      "endTime": "2022-10-01T19:30:00.000+0000",
    37      "resources": [
    38        "0HnS700000007xwKAA"
    39      ],
    40      "startTime": "2022-10-01T19:00:00.000+0000",
    41      "territoryId": "0HhS70000004F9zKAE"
    42    },
    43    {
    44      "endTime": "2022-10-01T20:00:00.000+0000",
    45      "resources": [
    46        "0HnS700000007xwKAA"
    47      ],
    48      "startTime": "2022-10-01T19:30:00.000+0000",
    49      "territoryId": "0HhS70000004F9zKAE"
    50    },
    51    {
    52      "endTime": "2022-10-01T20:30:00.000+0000",
    53      "resources": [
    54        "0HnS700000007xwKAA"
    55      ],
    56      "startTime": "2022-10-01T20:00:00.000+0000",
    57      "territoryId": "0HhS70000004F9zKAE"
    58    },
    59    {
    60      "endTime": "2022-10-01T21:00:00.000+0000",
    61      "resources": [
    62        "0HnS700000007xwKAA"
    63      ],
    64      "startTime": "2022-10-01T20:30:00.000+0000",
    65      "territoryId": "0HhS70000004F9zKAE"
    66    },
    67    {
    68      "endTime": "2022-10-01T21:30:00.000+0000",
    69      "resources": [
    70        "0HnS700000007xwKAA"
    71      ],
    72      "startTime": "2022-10-01T21:00:00.000+0000",
    73      "territoryId": "0HhS70000004F9zKAE"
    74    },
    75    {
    76      "endTime": "2022-10-01T22:00:00.000+0000",
    77      "resources": [
    78        "0HnS700000007xwKAA"
    79      ],
    80      "startTime": "2022-10-01T21:30:00.000+0000",
    81      "territoryId": "0HhS70000004F9zKAE"
    82    },
    83    {
    84      "endTime": "2022-10-01T22:30:00.000+0000",
    85      "resources": [
    86        "0HnS700000007xwKAA"
    87      ],
    88      "startTime": "2022-10-01T22:00:00.000+0000",
    89      "territoryId": "0HhS70000004F9zKAE"
    90    },
    91    {
    92      "endTime": "2022-10-01T23:00:00.000+0000",
    93      "resources": [
    94        "0HnS700000007xwKAA"
    95      ],
    96      "startTime": "2022-10-01T22:30:00.000+0000",
    97      "territoryId": "0HhS70000004F9zKAE"
    98    },
    99    {
    100      "endTime": "2022-10-01T23:30:00.000+0000",
    101      "resources": [
    102        "0HnS700000007xwKAA"
    103      ],
    104      "startTime": "2022-10-01T23:00:00.000+0000",
    105      "territoryId": "0HhS70000004F9zKAE"
    106    },
    107    {
    108      "endTime": "2022-10-02T00:00:00.000+0000",
    109      "resources": [
    110        "0HnS700000007xwKAA"
    111      ],
    112      "startTime": "2022-10-01T23:30:00.000+0000",
    113      "territoryId": "0HhS70000004F9zKAE"
    114    },
    115    {
    116      "endTime": "2022-10-02T00:30:00.000+0000",
    117      "resources": [
    118        "0HnS700000007xwKAA"
    119      ],
    120      "startTime": "2022-10-02T00:00:00.000+0000",
    121      "territoryId": "0HhS70000004F9zKAE"
    122    }
    123  ]
    124}
  2. Parse the JSON response, and show the actual service resources on a page. Business managers or administrators can select an actual resource for the appointment.