Appointment API
-
- UpdatedJan 30, 2025
- 22 minutes to read
- Yokohama
- API reference
The Appointment API provides endpoints for interacting with the appointment booking application. Use this API to book and reschedule appointments, check available appointment slots, and fetch appointment booking configuration details.
Before using this API, the Appointment Booking Configuration and Service Configuration must be setup. In addition, a task for which the appointment is being booked must already exist. For additional information, see Configuring Appointment Booking.
The Appointment API requires the Appointment Booking plugin (com.snc.appointment_booking) and is provided within the sn_apptmnt_booking
namespace. To access this API you must have the snc_internal
role.
Appointment - GET /sn_apptmnt_booking/appointment/calendar
Returns the time range for which you can book appointments. The return results honor the lead time and maximum future bookable dates configured in the appointment booking service configuration.
For additional information on lead time and maximum future bookable dates configuration, see Create or modify an appointment booking application configuration.
You must have either the snc_internal or snc_external role to access this endpoint.
URL format
Versioned URL: /api/sn_apptmnt_booking/{api_version}/appointment/calendar
Default URL: /api/sn_apptmnt_booking/appointment/calendar
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
catalog_id | Required. Sys_id of the record producer configured with an appointment booking service configuration. Table: Record Producer [sc_cat_item_producer] Data type: String |
location | Required. Sys_id of the location of the appointment. Table: Location [cmn_location] Data type: String |
opened_for | Required. Sys_id of the user for whom the appointment is being booked. Table: User [sys_user] Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Name | Description |
---|---|
result | Information about the results of the endpoint request. Data type: Object |
result.range_end | End of the range in which the appointments can be booked.
Data type: String Format: Appointment’s time zone in internal date time format. |
result.range_start | Start of the range in which the appointments can be booked.
Data type: String Format: Appointment’s time zone in internal date time format. |
Example: cURL request
The following code example shows how to call this endpoint.
Result:
Appointment - GET /sn_apptmnt_booking/appointment/configuration
Returns the configuration defined in a specified Appointment Booking Service Configuration.
In addition, it returns the translations and user date and time preferences required to render the slots on the appointment booking widgets.
You must have either the snc_internal or snc_external role to access this endpoint.
URL format
Versioned URL: /api/sn_apptmnt_booking/{api_version}/appointment/configuration
Default URL: /api/sn_apptmnt_booking/appointment/configuration
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
catalog_id | Required. Sys_id of the record producer configured with the appointment booking service configuration. Data type: String Table: Record Producer [sc_cat_item_producer] |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
The following code example shows how to call this endpoint.
Response:
Appointment - GET /sn_apptmnt_booking/appointment/execute_rule_conditions
Returns the sys_id of the appointment booking service configuration rule that matches a specified task sys_id or a set of specified catalog item data.
The passed task ID or catalog item data is evaluated against the rules defined for a service configuration. The sys_id for the first rule for which these conditions match is returned. You must then pass this rule sys_id to subsequent availability requests to fetch the correct slots, which are defined in the rule.
You must have either the snc_internal or snc_external role to access this endpoint.
URL format
Versioned URL: /api/sn_apptmnt_booking/{api_version}/appointment/execute_rule_conditions
Default URL: /api/sn_apptmnt_booking/appointment/execute_rule_conditions
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Name | Description |
---|---|
catalogId | Required. Sys_id of the record producer configured with the appointment booking service configuration. Data type: String Table: Record Producer [sc_cat_item_producer] |
otherInputs | Required if the taskId parameter isn’t specified. Name-value pairs of catalog item variables to compare against the rules defined for a service configuration. For
example: Data type: Object |
taskId | Required if the otherInputs parameter isn’t specified. Sys_id of the task record for which the appointment is being booked. Located in the task table for which the appointment is being booked. The catalogId corresponds to a particular appointment booking configuration and every config has a task table on which the appointment is booked. Data type: String |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
The following code example shows how to use the taskId parameter to make the rule comparison request.
Response:
Example: cURL request
The following code example shows how to use the otherInputs parameter to make the rule comparison request.
Response:
Appointment - POST /sn_apptmnt_booking/appointment/appointment
Enables you to book and reschedule appointments for a Field Service Management task.
For additional information on Field Service Management tasks, see Configuring Appointment Booking.
URL format
Versioned URL: /api/sn_apptmnt_booking/{api_version}/appointment/appointment
Default URL: /api/sn_apptmnt_booking/appointment/appointment
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
The following example shows how to create a new appointment booking for a task in the Work Order [wm_order] table.
Response:
Appointment - POST /sn_apptmnt_booking/appointment/availability
Returns the slots that have been configured in the appointment booking service configuration along with their availability.
If advanced configurations are enabled for the service configuration, the endpoint honors these configurations, and returns the data according to the rules and advanced configuration. You can also use this endpoint to find the
first available slot by passing the get_next_available_slot parameter or get_next_available_day_data parameter in the request body as true
.
You must have either the snc_internal or snc_external role to access this endpoint.
URL format
Versioned URL: /api/sn_apptmnt_booking/{api_version}/appointment/availability
Default URL: /api/sn_apptmnt_booking/appointment/availability
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
The following code example shows how to call this endpoint.
Response:
On this page
- Appointment - GET /sn_apptmnt_booking/appointment/calendar
- Appointment - GET /sn_apptmnt_booking/appointment/configuration
- Appointment - GET /sn_apptmnt_booking/appointment/execute_rule_conditions
- Appointment - POST /sn_apptmnt_booking/appointment/appointment
- Appointment - POST /sn_apptmnt_booking/appointment/availability