Get Work Types

Get the correct work type record that represents the work type group and service territory that are selected in the previous step.

A work type represents a type of work to be performed in Salesforce Scheduler. A work type is a template representing an appointment topic (work type group) with an appointment location (service territory). It defines key appointment parameters such as appointment duration, preparation and wrap-up buffers, and availability timings.

  1. Use the Query() request on the WorkTypeGroupMember object to retrieve a work type for the work type group selected in the Get Work Type Groups step.

    Sample Request

    This sample REST API call uses the Query() request retrieve work type records that are associated with the selected work type group.

    1https://yourInstance.salesforce.com/services/data/vXX.X/query/?q=SELECT+Id,Name,
    2WorkTypeGroupId,WorkTypeId+FROM+WorkTypeGroupMember+WHERE+WorkTypeGroupId+=+'0VSB0000000TbhWOAS'

    Sample Response

    The request returns the work type records.

    1{
    2  "totalSize" : 2,
    3  "done" : true,
    4  "records" : [ {
    5    "attributes" : {
    6      "type" : "WorkTypeGroupMember",
    7      "url" : "/services/data/v53.0/sobjects/WorkTypeGroupMember/0WzB0000000TbZcKAK"
    8    },
    9    "Id" : "0WzB0000000TbZcKAK",
    10    "Name" : "00000047",
    11    "WorkTypeGroupId" : "0VSB0000000TbhWOAS",
    12    "WorkTypeId" : "08qB00000002ocgIAA"
    13  }, {
    14    "attributes" : {
    15      "type" : "WorkTypeGroupMember",
    16      "url" : "/services/data/v53.0/sobjects/WorkTypeGroupMember/0WzB0000000Tbm5KAC"
    17    },
    18    "Id" : "0WzB0000000Tbm5KAC",
    19    "Name" : "00000048",
    20    "WorkTypeGroupId" : "0VSB0000000TbhWOAS",
    21    "WorkTypeId" : "08qB0000000UF63IAG"
    22  } ]
    23}
  2. Use the Query() request on the ServiceTerritoryWorkType object to filter the correct work type for the selected service territory selected in the Get Service Territories step.

    Sample Request

    This sample REST API call uses the Query() request to find the correct work type for the selected service territory.

    1https://yourInstance.salesforce.com/services/data/vXX.X/query/?q=SELECT+Id,Name,
    2ServiceTerritoryId,WorkTypeId+FROM+ServiceTerritoryWorkType+WHERE+WorkTypeId+=+'08qB00000002ocgIAA'+AND+
    3ServiceTerritoryId+=+'0HhB00000001P0PKAU'

    Sample Response

    The request returns the work type records.

    1{
    2  "totalSize" : 1,
    3  "done" : true,
    4  "records" : [ {
    5    "attributes" : {
    6      "type" : "ServiceTerritoryWorkType",
    7      "url" : "/services/data/v53.0/sobjects/ServiceTerritoryWorkType/0VEB0000000TbbrOAC"
    8    },
    9    "Id" : "0VEB0000000TbbrOAC",
    10    "Name" : "00000063",
    11    "ServiceTerritoryId" : "0HhB00000001P0PKAU",
    12    "WorkTypeId" : "08qB00000002ocgIAA"
    13  } ]
    14}

On the next page in your app, you can show the service resources and their availability.