Newer Version Available
Service Appointments
Create service appointments, assign resources, and generate leads.
Service appointments can be created either with the parentRecordId or the lead but not both. Use
lead to create service appointments with
unauthenticated guest users.
- Resource
-
1/connect/scheduling/service-appointments - Available version
- 48.0
- Requires Chatter
- No
- HTTP methods
- POST
- Request body for POST
-
- JSON example
-
1{ 2 "serviceAppointment": { 3 "parentRecordId": "0012w000004oZXgAAM", 4 "workTypeId": "08q2w000000XmniAAC", 5 "serviceTerritoryId": "0Hh2w000000XmoXCAS", 6 "schedStartTime": "2020-02-26T15:00:00.000Z", 7 "schedEndTime": "2020-02-26T16:00:00.000Z", 8 "street": "1 Market Street", 9 "city": "San Francisco", 10 "state": "CA", 11 "postalCode": "94105", 12 "country": "USA", 13 "appointmentType": "In Person", 14 "extendedFields": [ 15 { 16 "name": "Email", 17 "value": "rachel.adams@salesforce.com" 18 }, 19 { 20 "name": "Phone", 21 "value": "111111111" 22 }, 23 { 24 "name": "Description", 25 "value": "Test Description" 26 } 27] 28 }, 29 "assignedResources": [ 30 { 31 "serviceResourceId": "0Hn2w000000gDWDCA2", 32 "isRequiredResource": true, 33 "isPrimaryResource": true, 34 "extendedFields": [] 35 }, 36 { 37 "serviceResourceId": "0Hn2w000000gCqnCAE", 38 "isRequiredResource": true, 39 "isPrimaryResource": false, 40 "extendedFields": [] 41 } 42 ] 43} - JSON example for unauthenticated user
-
1{ 2 "serviceAppointment": { 3 "workTypeId": "08q2w000000XmniAAC", 4 "serviceTerritoryId": "0Hh2w000000XmoXCAS", 5 "schedStartTime": "2020-02-26T15:00:00.000Z", 6 "schedEndTime": "2020-02-26T16:00:00.000Z", 7 "street": "1 Market Street", 8 "city": "San Francisco", 9 "state": "CA", 10 "postalCode": "94105", 11 "country": "USA", 12 "appointmentType": "In Person", 13 "extendedFields": [] 14 }, 15 "assignedResources": [ 16 { 17 "serviceResourceId": "0Hn2w000000gDWDCA2", 18 "isRequiredResource": true, 19 "isPrimaryResource": true, 20 "extendedFields": [] 21 } 22 ], 23 "lead": { 24 "firstName": "Rachel", 25 "lastName": "Adams", 26 "phone": "012-345-6789", 27 "email": "rachel.adams@salesforce.com", 28 "company": "Salesforce", 29 "extendedFields": [] 30 } 31} - Properties
-
Name Type Description Required or Optional Available Version assignedResources Assigned Resource Input[] Service resource who is assigned to a service appointment. Optional 48.0 lead Lead Input[] Prospect or lead. Required if serviceAppointment isn’t provided 48.0 schedulingPolicyId String The ID of the AppointmentSchedulingPolicy object. If no scheduling policy is passed in the request body, the default configurations are used. The only scheduling policy configuration that is used in determining time slots is the enforcement of account visiting hours. Optional 48.0 serviceAppointment Service Appointment Input[] Appointment to complete a service work for a customer. Required if lead isn’t provided 48.0
- Response body for POST
- Service Appointment Output