{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":465,"path":"api-reference/rest-apis/appointment-api.md","title":"Appointment API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Appointment API\n\nThe 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.\n\nBefore 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/appointment-booking-administer.md).\n\nThe 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.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Appointment - GET /sn\\_apptmnt\\_booking/appointment/calendar\n\nReturns 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.\n\nFor additional information on lead time and maximum future bookable dates configuration, see [Create or modify an application configuration for Appointment Booking](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/appt-booking-create-app-config.md).\n\nYou must have either the snc\\_internal or snc\\_external role to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_apptmnt_booking/{api_version}/appointment/calendar`\n\nDefault URL: `/api/sn_apptmnt_booking/appointment/calendar`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncatalog\\_id\n\n</td><td>\n\nRequired. Sys\\_id of the record producer configured with an appointment booking service configuration.Table: Record Producer \\[sc\\_cat\\_item\\_producer\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nRequired. Sys\\_id of the location of the appointment.Table: Location \\[cmn\\_location\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nopened\\_for\n\n</td><td>\n\nRequired. Sys\\_id of the user for whom the appointment is being booked.Table: User \\[sys\\_user\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nInformation about the results of the endpoint request.Data type: Object\n\n```\n\"result\": {\n  \"range_end\": \"String\",\n  \"range_start\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.range\\_end\n\n</td><td>\n\nEnd of the range in which the appointments can be booked. `Range End = Today + Maximum future bookable days`\n\nData type: String\n\nFormat: Appointment’s time zone in internal date time format.\n\n</td></tr><tr><td>\n\nresult.range\\_start\n\n</td><td>\n\nStart of the range in which the appointments can be booked.`Range Start = Today + Lead time`\n\nData type: String\n\nFormat: Appointment’s time zone in internal date time format.\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following code example shows how to call this endpoint.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_apptmnt_booking/v1/appointment/calendar?catalog_id=e4c1116b3b810300ce8a4d72f3efc40f&location=32e8499cdb2d2200d75270f5bf9619d6&opened_for=6816f79cc0a8016401c5a33be04be441\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResult:\n\n```\n{\n  \"result\": {\n    \"range_start\": \"2023-02-08 03:52:27\",\n    \"range_end\": \"2023-02-21 23:52:27\"\n  }\n}\n```\n\n## Appointment - GET /sn\\_apptmnt\\_booking/appointment/configuration\n\nReturns the configuration defined in a specified Appointment Booking Service Configuration.\n\nIn addition, it returns the translations and user date and time preferences required to render the slots on the appointment booking widgets.\n\nYou must have either the snc\\_internal or snc\\_external role to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_apptmnt_booking/{api_version}/appointment/configuration`\n\nDefault URL: `/api/sn_apptmnt_booking/appointment/configuration`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncatalog\\_id\n\n</td><td>\n\nRequired. Sys\\_id of the record producer configured with the appointment booking service configuration.Data type: String\n\nTable: Record Producer \\[sc\\_cat\\_item\\_producer\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nResults of the endpoint request.Data type: Object\n\n```\n\"result\": {\n  \"active\": Boolean,\n  \"active_string\": \"String\",\n  \"advanced_calendar_view_portal\": Boolean,\n  \"auto_acceptance\": Boolean,\n  \"locale_language\": \"String\",\n  \"service_config\": {Object},\n  \"task_table\": \"String\",\n  \"translations\": {Object},\n  \"userDateFormatOptions\": {Object},\n  \"useRR\": Boolean,\n  \"userTimeFormat\": {Object},\n  \"userTimeFormatOptions\": {Object},\n  \"view_scale\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.active\n\n</td><td>\n\nFlag that indicates whether the service configuration setup for the associated catalog ID is active.Possible values:\n\n-   true: Service configuration setup for the catalog ID is active.\n-   false: Service configuration setup for the catalog ID isn't active.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.active\\_string\n\n</td><td>\n\nText representation of the status of the service configuration setup for the associated catalog ID.Data type: String\n\n</td></tr><tr><td>\n\nresult.advanced\\_calendar\\_view\\_portal\n\n</td><td>\n\nFlag that indicates whether the advanced calendar view displays on the portal or displays the base view. For additional information on the advanced calendar view, see [Create or modify an application configuration for Appointment Booking](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/appt-booking-create-app-config.md).Possible values:\n\n-   true: Advanced calendar view displays on the portal.\n-   false: Basic view displays on the portal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.auto\\_acceptance\n\n</td><td>\n\nFlag that indicates whether the appointment automatically transitions to the accepted state.Possible values:\n\n-   true: Appointment automatically transitions to the accepted state.\n-   false: Agent must manually accept the appointment.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.locale\\_language\n\n</td><td>\n\nUser's language setting.Data type: String\n\nFormat: ISO 639.1 language code\n\n</td></tr><tr><td>\n\nresult.service\\_config\n\n</td><td>\n\nDetails about the service configuration.Data type: Object\n\n```\n\"service_config\": {\n  \"active\": Boolean,\n  \"active_string\": \"String\",\n  \"appointment_booking_config\": \"String\",\n  \"appointment_duration\": \"String\",\n  \"appointments_per_bookable_slot\": \"String\",\n  \"bookable_days\": \"String\",\n  \"cancel_by_time\": \"String\",\n  \"default_timezone\": \"String\",\n  \"enable_advanced_config\": Boolean,\n  \"field_mapping\": {Object},\n  \"future_bookable_max_days\": \"String\",\n  \"lead_time\": \"String\",\n  \"mandatory\": \"String\",\n  \"use_slot_end_time_as\": \"String\",\n  \"work_duration\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.service\\_config.active\n\n</td><td>\n\nFlag that indicates the active status of the appointment booking service configuration.Possible values:\n\n-   true: Active\n-   false: Inactive\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.service\\_config.active\\_string\n\n</td><td>\n\nText representation of the status of the appointment booking service configuration.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.​appointment\\_booking\\_config\n\n</td><td>\n\nSys\\_id of the appointment booking service configuration setup for the associated catalog ID.Data type: String\n\nTable: Appointment Booking Service Configuration \\[sn\\_apptmnt\\_booking\\_service\\_config\\]\n\n</td></tr><tr><td>\n\nresult.service\\_config.​appointment\\_duration\n\n</td><td>\n\nLength of the appointment.Data type: String\n\nUnit: Minutes\n\n</td></tr><tr><td>\n\nresult.service\\_config.​appointments\\_per\\_bookable\\_slot\n\n</td><td>\n\nNumber of appointments that can be booked for the associated slot.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.​bookable\\_days\n\n</td><td>\n\nComma-separated values representing the days on which appointments can be booked. Days are represented as integers where, Monday = 1 and Sunday = 7.\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.cancel\\_by\\_time\n\n</td><td>\n\nMinimum amount of time prior to the start of an appointment that a user can cancel the appointment. For example, if you have an appointment booked for 1:00pm and there's a 2 hour cancel by time, you must cancel the appointment no later than 10:59 am.Format: This value is the date and time difference from “1970-01-01 00:00:00”. So if the returned value is \"1970-01-01 04:00:00, it means that the room must be canceled four hours before the meeting starts.\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.default\\_timezone\n\n</td><td>\n\nTime zone configuration that appointments are booked in. Possible values:\n\n-   location: Use the time zone of the location of the appointment.\n-   user: Use the time zone of the person for whom the appointment is being booked.\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.​enable\\_advanced\\_config\n\n</td><td>\n\nFlag that indicates whether appointment booking configurations and appointment booking rules are considered when booking appointments. For additional information, see [Create appointment booking advanced configuration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/appintment-booking-day-level-config.md).Possible values:\n\n-   true: Appointment booking configurations and appointment booking rules are considered when booking appointments.\n-   false: Appointment booking configurations and appointment booking rules aren't considered when booking appointments.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping\n\n</td><td>\n\nDetails about the catalog variables mapped to the location and contact values used to book the appointment.Data type: Object\n\n```\n\"field_mapping\": {\n  \"contact\": \"String\",\n  \"contactRPVariable\": {Object},\n  \"location\": \"String\",\n  \"locationRPVariable\": {Object}\n}\n```\n\n</td></tr><tr><td>\n\nresult.service\\_config.​field\\_mapping.contact\n\n</td><td>\n\nName of the catalog variable that contains the contact value.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​contactRPVariable\n\n</td><td>\n\nDetails about the location catalog variables data.Data type: Object\n\n```\n\"contactRPVariable\": {\n  \"displayName\": \"String\",\n  \"label\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​contactRPVariable.displayName\n\n</td><td>\n\nDisplay name of the contact catalog variable.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​contactRPVariable.label\n\n</td><td>\n\nLabel of the contact catalog variable.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​contactRPVariable.name\n\n</td><td>\n\nName of the contact catalog variable.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.​field\\_mapping.location\n\n</td><td>\n\nName of the catalog variable that contains the location value.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​locationRPVariable\n\n</td><td>\n\nDetails about the location catalog variables data.Data type: Object\n\n```\n\"locationRPVariable\": {\n  \"displayName\": \"String\",\n  \"label\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​locationRPVariable.displayName\n\n</td><td>\n\nDisplay name of the location catalog variable.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​locationRPVariable.label\n\n</td><td>\n\nLabel of the location catalog variable.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.field\\_mapping.​locationRPVariable.name\n\n</td><td>\n\nName of the location catalog variable.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.​ future\\_bookable\\_max\\_days\n\n</td><td>\n\nMaximum number of days in the future that an appointment can be booked.Data type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.lead\\_time\n\n</td><td>\n\nMinimum amount of time prior to the start of an appointment that a user can book the appointment. For example, if you want to book an appointment at 1:00pm and there’s a 2-hour lead time, you must book the appointment no later than 10:59 am.Format: This value is the date and time difference from “1970-01-01 00:00:00”. So if the returned value is \"1970-01-01 04:00:00, it means that the room must be booked four hours before the meeting starts.\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.mandatory\n\n</td><td>\n\nIndicator for whether the appointment is mandatory.Possible values:\n\n-   0: Appointment isn't mandatory.\n-   1: Appointment is mandatory.\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.​use\\_slot\\_end\\_time\\_as\n\n</td><td>\n\nIndicator as to when an agent will arrive or complete the work scheduled for the associated appointment.Possible values:\n\n-   arrive\\_by: Agent will arrive at the location for the appointment within the specified time slot.\n-   complete\\_by: Agent will complete the work for the appointment within the specified time slot.\n-   empty: Same as completed\\_by.\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.service\\_config.work\\_duration\n\n</td><td>\n\nAmount of time it takes to work on the appointment. Work duration is configured in the appointment booking service configuration. For additional information, see [Create or modify service configuration for Appointment Booking](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/appt-booking-create-service-config.md).Data type: String\n\nUnit: Minutes\n\n</td></tr><tr><td>\n\nresult.task\\_table\n\n</td><td>\n\nName of the table for which the appointment can be booked. Configured in the appointment booking service configuration.Data type: String\n\n</td></tr><tr><td>\n\nresult.translations\n\n</td><td>\n\nName-value pairs of text translations used by the appointment booking widget. Contains translated values for actions, messages, days, and months.Data type: Object\n\n</td></tr><tr><td>\n\nresult.userDateFormatOptions\n\n</td><td>\n\nDescribes the date format options that are needed to render JS date objects. These values are set in appointment booking constants which are not modifiable.Data type: Object\n\n```\n\"userDateFormatOptions\": {\n  \"day\": \"String\",\n  \"month\": \"String\",\n  \"week\": \"String\",\n  \"weekday\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.userDateFormatOptions.day\n\n</td><td>\n\nDay date format.Data type: String\n\nFormat: Numeric \\(Values or 1-31\\)\n\n</td></tr><tr><td>\n\nresult.userDateFormatOptions.month\n\n</td><td>\n\nMonth date format.Data type: String\n\nFormat: Short \\(Values on Jan, Feb, Mar, and so on\\)\n\n</td></tr><tr><td>\n\nresult.userDateFormatOptions.week\n\n</td><td>\n\nWeek date format.Data type: String\n\nFormat: Numeric \\(Values of 1-5\\)\n\n</td></tr><tr><td>\n\nresult.userDateFormatOptions.weekday\n\n</td><td>\n\nWeekday date format.Data type: String\n\nFormat: Short \\(Values of Mon, Tue, Wed, and so on\\)\n\n</td></tr><tr><td>\n\nresult.useRR\n\n</td><td>\n\nValue of the sn\\_apptmnt\\_booking.use\\_read\\_replica\\_from\\_ui property. This value defines whether to use the read replica database to fetch appointment slots when the query is performed from the UI.Possible values:\n\n-   true: Use the read replica database to fetch the slots.\n-   false: Don't use the read replica database to fetch the slots.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.userTimeFormat\n\n</td><td>\n\nDescribes the user's time format. The user is the person making the endpoint request. If made through the platform, it is an agent. If made through the portal, it is a customer.\n\nData type: Object\n\n```\n\"userTimeFormat\": {\n  \"type\": \"String\",\n  \"value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.userTimeFormat.type\n\n</td><td>\n\nType of time format.Possible values:\n\n-   12hr\n-   24hr\n\nData type: String\n\n</td></tr><tr><td>\n\nresult.userTimeFormat.value\n\n</td><td>\n\nPreferred time format, such as \"HH:mm:ss\".Data type: String\n\n</td></tr><tr><td>\n\nresult.userTimeFormatOptions\n\n</td><td>\n\nDescribes the time format options that are needed to render JS time objects. These values are set in the appointment booking constants which can't be modified.Data type: Object\n\n```\n\"userTimeFormatOptions\": {\n  \"hour\": \"String\",\n  \"hourCycle\": \"String\",\n  \"minute\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.userTimeFormatOptions.hour\n\n</td><td>\n\nFormat for hours.Format: numeric \\(Values 1-12\\)\n\n</td></tr><tr><td>\n\nresult.userTimeFormatOptions.hourCycle\n\n</td><td>\n\nFormat for hour cycle.Only possible value is `h23`.\n\n</td></tr><tr><td>\n\nresult.userTimeFormatOptions.minute\n\n</td><td>\n\nFormat for minutes.Format: numeric \\(Values of 1-60\\)\n\n</td></tr><tr><td>\n\nresult.view\\_scale\n\n</td><td>\n\nView configured in the service configuration. Possible values:\n\n-   day\n-   week\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following code example shows how to call this endpoint.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_apptmnt_booking/v1/appointment/configuration?catalog_id=e4c1116b3b810300ce8a4d72f3efc40f\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user ‘username':'password'\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"active\": true,\n    \"activeString\": \"true\"\n    \"view_scale\": \"day\",\n    \"auto_acceptance\": true,\n    \"task_table\": \"wm_order\",\n    \"advanced_calendar_view_portal\": false,\n    \"service_config\": {\n      \"appointment_booking_config\": \"deb1d2fd3b033200ce8a4d72f3efc4c2\",\n      \"future_bookable_max_days\": \"14\",\n      \"appointments_per_bookable_slot\": \"20\",\n      \"bookable_days\": \"1,2,3,4,5\",\n      \"active\": true,\n      \"activeString\": \"true\",\n      \"mandatory\": \"1\",\n      \"lead_time\": \"1970-01-01 04:00:00\",\n      \"cancel_by_time\": \"1970-01-01 04:00:00\",\n      \"appointment_duration\": \"120\",\n      \"default_timezone\": \"location\",\n      \"work_duration\": \"60\",\n      \"enable_advanced_config\": true,\n      \"field_mapping\": {\n        \"location\": \"location\"\n        \"opened_for\": \"contact\",\n        \"locationRPVariable\": {\n          \"name\": \"location\",\n          \"label\": \"Location\",\n          \"displayName\": \"location\"\n        },\n        \"contactRPVariable\": {\n          \"name\": \"contact\",\n          \"label\": \"Contact\",\n          \"displayName\": \"contact\"\n        }\n      },\n      \"use_slot_end_time_as\": \"\"\n    },\n    \"translations\": {\n      \"submit_btn_text\": \"Select\",\n      \"cancel_btn_text\": \"Cancel\",\n      \"calendar_prev_text\": \"Previous\",\n      \"select_appointment_calendar_text\": \"Select Appointment Calendar\",\n      \"calendar_next_text\": \"Next\",\n      \"previous_btn_text\": \"Previous day\",\n      \"next_btn_text\": \"Next day\",\n      \"date_input_placeholder_text\": \"Pick a date\",\n      \"show_calendar_btn_text\": \"Show Calendar\",\n      \"app_window_btn_text_start_time\": \"Start time\",\n      \"app_window_btn_text_end_time\": \"End time\",\n      \"appointment_window_aria_label_start_text\": \"Available appointment window \",\n      \"no_appointment\": \"No appointments\",\n      \"time_zone\": \"Time zone\",\n      \"selected_window\": \"The window which has been selected is \",\n      \"day_names\": {\n        \"1\": \"Monday\",\n        \"2\": \"Tuesday\",\n        \"3\": \"Wednesday\",\n        \"4\": \"Thursday\",\n        \"5\": \"Friday\",\n        \"6\": \"Saturday\",\n        \"7\": \"Sunday\"\n      },\n      \"days\": [\n        \"Sunday\",\n        \"Monday\",\n        \"Tuesday\",\n        \"Wednesday\",\n        \"Thursday\",\n        \"Friday\",\n        \"Saturday\"\n      ],\n      \"daysShort\": [\n        \"Sun\",\n        \"Mon\",\n        \"Tue\",\n        \"Wed\",\n        \"Thu\",\n        \"Fri\",\n        \"Sat\"\n      ],\n      \"daysMin\": [\n        \"Su\",\n        \"Mo\",\n        \"Tu\",\n        \"We\",\n        \"Th\",\n        \"Fr\",\n        \"Sa\"\n      ],\n      \"months\": [\n        \"January\",\n        \"February\",\n        \"March\",\n        \"April\",\n        \"May\",\n        \"June\",\n        \"July\",\n        \"August\",\n        \"September\",\n        \"October\",\n        \"November\",\n        \"December\"\n      ],\n      \"monthsShort\": [\n        \"Jan\",\n        \"Feb\",\n        \"Mar\",\n        \"Apr\",\n        \"May\",\n        \"Jun\",\n        \"Jul\",\n        \"Aug\",\n        \"Sep\",\n        \"Oct\",\n        \"Nov\",\n        \"Dec\"\n      ],\n      \"today\": \"Today\",\n      \"clear\": \"Clear\",\n      \"language\": \"en\",\n      \"arrive_by_msg\": \"The agent will arrive within the selected slot.\"\n    },\n    \"useRR\": true,\n    \"locale_language\": \"en\",\n    \"userTimeFormat\": {\n      \"value\": \"HH:mm:ss\",\n      \"type\": \"24hr\"\n    },\n    \"userDateFormatOptions\": {\n      \"weekday\": \"short\",\n      \"year\": \"numeric\",\n      \"month\": \"short\",\n      \"day\": \"numeric\"\n    },\n    \"userTimeFormatOptions\": {\n      \"hour\": \"numeric\",\n      \"minute\": \"numeric\",\n      \"hourCycle\": \"h23\"\n    }\n  }\n}\n```\n\n## Appointment - GET /sn\\_apptmnt\\_booking/appointment/execute\\_rule\\_conditions\n\nReturns 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.\n\nThe 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.\n\nYou must have either the snc\\_internal or snc\\_external role to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_apptmnt_booking/{api_version}/appointment/execute_rule_conditions`\n\nDefault URL: `/api/sn_apptmnt_booking/appointment/execute_rule_conditions`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncatalogId\n\n</td><td>\n\nRequired. Sys\\_id of the record producer configured with the appointment booking service configuration.Data type: String\n\nTable: Record Producer \\[sc\\_cat\\_item\\_producer\\]\n\n</td></tr><tr><td>\n\notherInputs\n\n</td><td>\n\nRequired if the **taskId** parameter isn’t specified. Name-value pairs of catalog item variables to compare against the rules defined for a service configuration.\n\nFor example:\n\n```\n\"otherInputs\": {\n  \"u_sn_point_of_sale_variable_set\": \"true\",\n  \"short_description\": \"Point-of-Sale Installation\",\n  \"contact\": \"6816f79cc0a8016401c5a33be04be441\",\n  \"description\": \"Install new point-of-sale system with cash tray\",\n  \"location\": \"32e8499cdb2d2200d75270f5bf9619d6\"\n}\n```\n\nData type: Object\n\n</td></tr><tr><td>\n\ntaskId\n\n</td><td>\n\nRequired 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.\n\nData type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nDescription of the information returned by the endpoint.Data type: Object\n\n```\n“result\": {\n  \"dedicatedCapacity\": Boolean,\n  \"futureMaxBookableDays\": \"String\",\n  \"ruleId\": \"String\",\n  \"ruleName\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.dedicatedCapacity\n\n</td><td>\n\nFlag that indicates whether the associated rule has dedicated capacity. For additional information on dedicated capacity, see [Create service configuration rules for a service configuration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/create-appt-booking-service-config-rules.md).Possible values:\n\n-   true: Rule has dedicated capacity.\n-   false: Capacity is shared between the associated rule and the base configuration. It’s also shared with other rules that don't have dedicated capacity.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.futureMaxBookableDays\n\n</td><td>\n\nMaximum number of days in the future for which an appointment with the matching rule can be booked.Data type: String\n\n</td></tr><tr><td>\n\nresult.ruleId\n\n</td><td>\n\nSys\\_id of the appointment booking service configuration rule that matches the **taskId** or **otherInputs** parameters passed in the request.Data type: String\n\nTable: Service Configuration Rule \\[sn\\_apptmnt\\_booking\\_config\\_rule\\]\n\n</td></tr><tr><td>\n\nresult.ruleName\n\n</td><td>\n\nName of the rule that matched the passed parameters.Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following code example shows how to use the **taskId** parameter to make the rule comparison request.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_apptmnt_booking/v1/appointment/execute_rule_conditions\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \\\"catalogId\\\": \\\"e4c1116b3b810300ce8a4d72f3efc40f\\\",\n  \\\"taskId\\\": \\\"ce1f397c43b861105e0dbcba6ab8f298\\\"}\" \\\n--user 'username':'password'\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"ruleId\": \"f7d5d98f437c21105e0dbcba6ab8f2fc\",\n    \"ruleName\": \"Priority 1 rule\",\n    \"dedicatedCapacity\": true,\n    \"futureMaxBookableDays\": \"14\"\n  }\n}\n```\n\n### cURL request\n\nThe following code example shows how to use the **otherInputs** parameter to make the rule comparison request.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_apptmnt_booking/v1/appointment/execute_rule_conditions\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \\\"catalogId\\\": \\\"e4c1116b3b810300ce8a4d72f3efc40f\\\",\n  \\\"otherInputs\\\": {\n    \\\"u_sn_point_of_sale_variable_set\\\": \\\"true\\\",\n    \\\"short_description\\\": \\\"Point-of-Sale Installation\\\",\n    \\\"contact\\\": \\\"6816f79cc0a8016401c5a33be04be441\\\",\n    \\\"description\\\": \\\"Install new point-of-sale system with cash tray\\\",\n    \\\"location\\\": \\\"32e8499cdb2d2200d75270f5bf9619d6\\\"\n  }\n}\" \\\n--user 'username':'password'\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"ruleId\": \" 1d1bb72b4334a1105e0dbcba6ab8f275\",\n    \"ruleName\": \"Lake View SC rule\",\n    \"dedicatedCapacity\": false,\n    \"futureMaxBookableDays\": \"21\"\n  }\n}\n```\n\n## Appointment - POST /sn\\_apptmnt\\_booking/appointment/appointment\n\nEnables you to book and reschedule appointments for a Field Service Management task.\n\n**Note:** This endpoint only enables you to book and schedule appointments that have start and end times defined in the associated appointment booking service configuration and have available slots.\n\nFor additional information on Field Service Management tasks, see [Configuring Appointment Booking](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/field-service-management/appointment-booking-administer.md).\n\n### URL format\n\nVersioned URL: `/api/sn_apptmnt_booking/{api_version}/appointment/appointment`\n\nDefault URL: `/api/sn_apptmnt_booking/appointment/appointment`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nactualEndDate\n\n</td><td>\n\nRequired. End date and time for the appointment slot in the appointment's time zone.Date type: String\n\nFormat: YYYY-MM-dd HH:mm:ss\n\n</td></tr><tr><td>\n\nactualStartDate\n\n</td><td>\n\nRequired. Start date and time for the appointment slot in the appointment's time zone.Date type: String\n\nFormat: YYYY-MM-dd HH:mm:ss\n\n</td></tr><tr><td>\n\ncatalogId\n\n</td><td>\n\nSys\\_id of the record producer configured for the appointment booking service configuration.If you don't pass this parameter, the endpoint will attempt to discern this information from the **taskId** and **taskTable** parameters. If it can't, the endpoint fails, and an error is returned.\n\nDate type: String\n\nTable: The Catalog Item field of the Appointment Booking Service Configuration \\[sn\\_apptmnt\\_booking\\_service\\_config\\] table.\n\n</td></tr><tr><td>\n\nendDateUTC\n\n</td><td>\n\nRequired. End date and time for the appointment slot in UTC time zone.Date type: String\n\nFormat: YYYY-MM-dd HH:mm:ss\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nRequired. Sys\\_id of the location record related to the appointment.Date type: String\n\nTable: Location \\[cmn\\_location\\]\n\n</td></tr><tr><td>\n\nopenedFor\n\n</td><td>\n\nRequired. Sys\\_id of the user for which the appointment is being booked.Date type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nreschedule\n\n</td><td>\n\nRequired. Flag that indicates whether the appointment is being rescheduled.Valid values:\n\n-   true: Appointment currently exists and is being rescheduled.\n-   false: New appointment.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nservice\\_cofig\\_rule\n\n</td><td>\n\nIf the appointment is being booked under a rule, the sys\\_id of the service configuration rule.Date type: String\n\nTable: Service Configuration Rule \\[sn\\_apptmnt\\_booking\\_config\\_rule\\]\n\n</td></tr><tr><td>\n\nstartDateUTC\n\n</td><td>\n\nRequired. Start date and time for the appointment slot in UTC time zone.Date type: String\n\nFormat: YYYY-MM-dd HH:mm:ss\n\n</td></tr><tr><td>\n\ntaskId\n\n</td><td>\n\nRequired. Sys\\_id of the task record for which the appointment is being booked.Date type: String\n\nTable: Defined in the **taskTable** parameter.\n\n</td></tr><tr><td>\n\ntaskTable\n\n</td><td>\n\nRequired. Name of the table containing the task record for which the appointment is being booked.Date type: String\n\n</td></tr><tr><td>\n\ntimezone\n\n</td><td>\n\nRequired. Time zone to use when booking or updating the specified appointment slot.Format: Country/City or Area format, such as US/Eastern\n\nDate type: String\n\n</td></tr><tr><td>\n\nvalidate\\_request\n\n</td><td>\n\nFlag that indicates whether to validate the appointment request. If any of the validations fail, the endpoint fails and returns an error message that describes the problem.The following validations are performed:\n\n-   Catalog ID validation: Verifies that the passed **catalogId** parameter is a valid sys\\_id.\n-   Time zone validation: Verifies that the passed **timezone** parameter is a valid time zone.\n-   Task ID validation: Verifies that the passed **taskId** parameter is a valid sys\\_id and the task is in the pending dispatch state.\n-   Duplicate slot validation: For reschedules, if you pass the same slot as the original appointment, the slot is invalid as the slot is technically already booked.\n-   Slot validation: Verifies that the passed slot information matches what is configured and that the slot has the same time frame. For example, if in the configuration a two-hour slot is configured, but you pass a three-hour slot, the slot is not valid. Similarly, if the 9:00 a.m. to 11:00 a.m. slot is available, but the passed slot is for 9:30 a.m. to 11:30 a.m., then the passed slot is invalid.\n\nValid values:\n\n-   true: Validate the appointment information.\n-   false: Don't validate the appointment information.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr></tbody>\n</table>### Headers\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nInformation about the results of the endpoint request.Data type: Object\n\n```\n\"result\": {\n  \"data\": \"String\",\n  \"message\": \"String\",\n  \"reason\": \"String\",\n  \"success\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nresult.data\n\n</td><td>\n\nSys\\_id of the appointment record that has been created or rescheduled.Data type: String\n\n</td></tr><tr><td>\n\nresult.message\n\n</td><td>\n\nMessage that explains whether the appointment request was scheduled or failed. For example, error responses might include:-   Your appointment cannot be scheduled.\n-   Your appointment cannot be rescheduled.\n\nIf the operation is successful, a message similar to the following is returned: Your appointment has been scheduled successfully.Data type: String\n\n</td></tr><tr><td>\n\nresult.reason\n\n</td><td>\n\nAdditional information about the results of the appointment request.Data type: String\n\n</td></tr><tr><td>\n\nresult.success\n\n</td><td>\n\nFlag that indicates whether the request was successful.Possible values:\n\n-   true: Request succeeded\n-   false: Request failed\n\nData type: Boolean\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to create a new appointment booking for a task in the Work Order \\[wm\\_order\\] table.\n\n```\ncurl \"https://instance.servicenow.com/api/sn_apptmnt_booking/appointment/appointment\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n\\\"startDateUTC\\\": \\\"2023-02-01 20:00:00\\\",\n\\\"endDateUTC\\\": \\\"2023-02-01 22:00:00\\\",\n\\\"actualStartDate\\\": \\\"2023-02-01 15:00:00\\\",\n\\\"actualEndDate\\\": \\\"2023-02-01 17:00:00\\\",\n\\\"taskTable\\\": \\\"wm_order\\\",\n\\\"location\\\": \\\"32e8499cdb2d2200d75270f5bf9619d6\\\",\n\\\"catalogId\\\": \\\"e4c1116b3b810300ce8a4d72f3efc40f\\\",\n\\\"openedFor\\\": \\\"ddce70866f9331003b3c498f5d3ee417\\\"\n\\\"taskId\\\": \\\"ce1f397c43b861105e0dbcba6ab8f298\\\",\n\\\"reschedule\\\": false,\n\\\"service_configuration_rule\\\": \\\"\\\",\n\\\"timezone\\\": \\\"US/Eastern\\\"\n}\" \\\n\n--user 'username':'password'\n```\n\nResponse:\n\n```\n{\n\"result\": {\n  \"success\": true,\n  \"message\": \"Your appointment has been scheduled successfully.\",\n  \"reason\": \"Appointment created!\",\n  \"data\": \"7a5f393c43b861105e0dbcba6ab8f29f\"\n  }\n}\n```\n\n## Appointment - POST /sn\\_apptmnt\\_booking/appointment/availability\n\nReturns the slots that have been configured in the appointment booking service configuration along with their availability.\n\nIf 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`.\n\nYou must have either the snc\\_internal or snc\\_external role to access this endpoint.\n\n### URL format\n\nVersioned URL: `/api/sn_apptmnt_booking/{api_version}/appointment/availability`\n\nDefault URL: `/api/sn_apptmnt_booking/appointment/availability`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncatalog\\_id\n\n</td><td>\n\nSys\\_id of the record producer configured for the appointment booking service configuration.If you don't pass this parameter, the endpoint will attempt to discern this information from the **taskId** and **task\\_table** parameters. If it can't, the endpoint fails, and an error is returned.\n\nData type: String\n\nTable: In the Catalog Item field in the related record of the Appointment Booking Service Configuration \\[sn\\_apptmnt\\_booking\\_service\\_config\\] table.\n\n</td></tr><tr><td>\n\nend\\_date\n\n</td><td>\n\nRequired. End date and time for which to fetch appointments.Data type: String\n\nFormat: UTC time zone and in the format YYYY-MM-dd HH:mm:ss\n\n</td></tr><tr><td>\n\nfetch\\_days\\_slot\n\n</td><td>\n\nFlag that indicates whether to return the first available slot in each day for the requested date range.Valid values:\n\n-   true: Return the first available slot for each day.\n-   false: Don't return the first available slot for each day.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nfull\\_day\n\n</td><td>\n\nRequired. Flag that indicates whether to return all appointments for the specified date range passed regardless of the time values in start and end date.Valid values:\n\n-   true: Return all appointments regardless of specified times.\n-   false: Only return appointments that correspond to the specified dates and times.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nget\\_next\\_available\\_slot\n\n</td><td>\n\nFlag that indicates whether to return the first available appointment slot with the response even if it isn't part of the passed-in **start\\_date** and **end\\_date** parameters.Valid values:\n\n-   true: Return the first available appointment slots.\n-   false: Don't return the first available appointment slots.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nlimit\n\n</td><td>\n\nMaximum number of appointments to return.Data type: Number\n\nDefault: Value specified in the sn\\_apptmnt\\_booking .max\\_appointments\\_ returned property or 1000 if the property is empty.\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nRequired. Sys\\_id of the location record associated with the appointment.Data type: String\n\nTable: Location \\[cmn\\_location\\]\n\n</td></tr><tr><td>\n\nopened\\_for\n\n</td><td>\n\nRequired. Sys\\_id of the user for which the appointment is being booked.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\notherInputs\n\n</td><td>\n\nName-value pairs of any other values needed to calculate the availability in the scripted method. Typically these values are catalog item variables, however, if you customize your booking application you can pass any values needed by your implementation.For example:\n\n```\n\"otherInputs\": {\n  \"u_sn_point_of_sale_variable_set\": \"true\",\n  \"short_description\": \"Point-of-Sale Installation\",\n  \"contact\": \"6816f79cc0a8016401c5a33be04be441\",\n  \"description\": \"Install new point-of-sale system with cash tray\",\n  \"location\": \"32e8499cdb2d2200d75270f5bf9619d6\"\n}\n```\n\nData type: Object\n\n</td></tr><tr><td>\n\nservice\\_config\\_rule\n\n</td><td>\n\nSys\\_id of the service configuration rule to use to calculate the appointment slots and availability.Data type: String\n\nTable: Service Configuration Rule \\[sn\\_apptmnt\\_booking\\_config\\_rule\\]\n\n</td></tr><tr><td>\n\nstart\\_date\n\n</td><td>\n\nRequired. Start date and time for which to fetch appointments.Data type: String\n\nFormat: UTC time zone and in the format YYYY-MM-dd HH:mm:ss\n\n</td></tr><tr><td>\n\ntaskId\n\n</td><td>\n\nSys\\_id of the task record for which the appointment is being booked.Date type: String\n\nTable: Defined in the **taskTable** parameter.\n\n</td></tr><tr><td>\n\ntask\\_table\n\n</td><td>\n\nRequired. Name of the table containing the task record for which the appointment is being booked.Data type: String\n\n</td></tr><tr><td>\n\nuse\\_read\\_replica\n\n</td><td>\n\nFlag that indicates whether to use the read replica of the database when fetching the appointment slots and their availability.Valid values:\n\n-   true: Use the read replica of the database.\n-   false: Don't use the read replica of the database.\n\nDefault: false\n\n</td></tr><tr><td>\n\nview\n\n</td><td>\n\nRequired. Origination point of the request.Valid values: \\(case-sensitive\\)\n\n-   platform\n-   portal\n\nData type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nDetails about the appointments that match the request.Data type: Object\n\n```\n\"result\": {\n \"availability\": [Array], \n \"has_more\": Boolean,\n \"next_available_slot\": {Object},\n \"no_appt_available\": Boolean,\n \"success\": Boolean,\n \"time_zone\": \"String\",\n \"time_zone_display_value\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.availability\n\n</td><td>\n\nList of appointment slots that meet the specified request. Data type: Array of Objects\n\n```\n\"availability\": [{\n  \"available\": Boolean,\n  \"end_date\": \"String\",\n  \"end_date_display\": \"String\",\n  \"end_dateUTC\": \"String\",\n  \"start_date\": \"String\", \n  \"start_date_display\": \"String\",\n  \"start_dateUTC\": \"String\"\n}]\n```\n\n</td></tr><tr><td>\n\nresult.availability.available\n\n</td><td>\n\nFlag that indicates whether the associated time slot is available.Possible values:\n\n-   true: Time slot is available.\n-   false: Times slot isn't available.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.availability.end\\_date\n\n</td><td>\n\nEnd date and time of the associated appointment. The time zone is based on the value in the **time\\_zone** parameter.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.availability.end\\_date\\_display\n\n</td><td>\n\nDisplay end date and time of the associated appointment. The time zone is based on the value in the **time\\_zone\\_display\\_value** parameter.Data type: String\n\nFormat: Requesting user's date time format.\n\n</td></tr><tr><td>\n\nresult.availability.end\\_dateUTC\n\n</td><td>\n\nEnd date and time of the associated appointment in UTC time.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.availability.start\\_date\n\n</td><td>\n\nStart date and time of the associated appointment. The time zone is based on the value in the **time\\_zone** parameter.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.availability.start\\_date\\_display\n\n</td><td>\n\nDisplay start date and time of the associated appointment. The time zone is based on the value in the **time\\_zone\\_display\\_value** parameter.Data type: String\n\nFormat: Requesting user's date time format.\n\n</td></tr><tr><td>\n\nresult.availability.start\\_dateUTC\n\n</td><td>\n\nStart date and time of the associated appointment in UTC time.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.has\\_more\n\n</td><td>\n\nFlag that indicates whether there are more appointment slots to fetch after returning the limit.Possible values:\n\n-   true: More appointment slots are available.\n-   false: No more slots are available.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot\n\n</td><td>\n\nIf the **get\\_next\\_available\\_slot** parameter was passed as true, details about the first available slot irrespective of the passed start and end date. Data type: Object\n\n```\n\"next_available_slot\": {\n  \"available\": Boolean,\n  \"end_date\": \"String\",\n  \"end_date_display\": \"String\",\n  \"end_dateUTC\": \"String\",\n  \"start_date\": \"String\", \n  \"start_date_display\": \"String\",\n  \"start_dateUTC\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.available\n\n</td><td>\n\nFlag that indicates whether the associated time slot is available.Possible values:\n\n-   true: Time slot is available.\n-   false: Times slot isn't available.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.end\\_date\n\n</td><td>\n\nEnd date and time of the associated appointment. The time zone is based on the value in the **time\\_zone** parameter.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.end\\_date\\_display\n\n</td><td>\n\nDisplay end date and time of the associated appointment. The time zone is based on the value in the **time\\_zone\\_display\\_value** parameter.Data type: String\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.end\\_dateUTC\n\n</td><td>\n\nEnd date and time of the associated appointment in UTC time.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.start\\_date\n\n</td><td>\n\nStart date and time of the associated appointment. The time zone is based on the value in the **time\\_zone** parameter.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.start\\_date\\_display\n\n</td><td>\n\nDisplay start date and time of the associated appointment. The time zone is based on the value in the **time\\_zone\\_display\\_value** parameter.Data type: String\n\n</td></tr><tr><td>\n\nresult.next\\_available\\_slot.start\\_dateUTC\n\n</td><td>\n\nStart date and time of the associated appointment in UTC time.Data type: String\n\nFormat: YYYY-MM-DD hh:mm:ss\n\n</td></tr><tr><td>\n\nresult.no\\_appt\\_available\n\n</td><td>\n\nFlag that indicates whether there are more appointment slots available for the specified date and time.Possible values:\n\n-   true: More appointment time slots are available.\n-   false: No more appointment time slots are available.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.success\n\n</td><td>\n\nFlag that indicates whether the endpoint call was successful.Possible values:\n\n-   true: Endpoint call was successful.\n-   false: Endpoint call failed.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.time\\_zone\n\n</td><td>\n\nTime zone in which the appointment slots were rendered. Based on the values in the appointment booking service configuration.Data type: String\n\n</td></tr><tr><td>\n\nresult.time\\_zone\\_display\\_value\n\n</td><td>\n\nDisplay time zone in which the appointment slots were rendered. Based on the values in the appointment booking service configuration.Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following code example shows how to call this endpoint.\n\n```\ncurl \"http://instance.servicenow.com/api/sn_apptmnt_booking/v1/appointment/availability\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \\\"start_date\\\": \\\"2023-02-05 05:00:00\\\",\n  \\\"end_date\\\": \\\"2023-02-07 04:59:59\\\",\n  \\\"location\\\": \\\"32e8499cdb2d2200d75270f5bf9619d6\\\",\n  \\\"catalog_id\\\": \\\"e4c1116b3b810300ce8a4d72f3efc40f\\\",\n  \\\"opened_for\\\": \\\"6816f79cc0a8016401c5a33be04be441\\\",\n  \\\"full_day\\\": false,\n  \\\"task_table\\\": \\\"wm_order\\\",\n  \\\"view\\\": \\\"portal\\\",\n  \\\"get_next_available_slot\\\": true,\n  \\\"use_read_replica\\\": true,\n  \\\"service_config_rule\\\": \\\"f7d5d98f437c21105e0dbcba6ab8f2fc\\\"\n}\" \\\n--user 'username':'password\n```\n\nResponse:\n\n```\n{\n\"result\": {\n  \"success\": true,\n  \"availability\": [\n    {\n      \"start_date\": \"2023-02-06 09:00:00\",\n      \"end_date\": \"2023-02-06 11:00:00\",\n      \"start_date_display\": \"09:00\",\n      \"end_date_display\": \"11:00\",\n      \"start_dateUTC\": \"2023-02-06 14:00:00\",\n      \"end_dateUTC\": \"2023-02-06 16:00:00\",\n      \"available\": false\n    },\n    {\n      \"start_date\": \"2023-02-06 13:00:00\",\n      \"end_date\": \"2023-02-06 15:00:00\",\n      \"start_date_display\": \"13:00\",\n      \"end_date_display\": \"15:00\",\n      \"start_dateUTC\": \"2023-02-06 18:00:00\",\n      \"end_dateUTC\": \"2023-02-06 20:00:00\",\n      \"available\": false\n    },\n    {\n      \"start_date\": \"2023-02-06 15:00:00\",\n      \"end_date\": \"2023-02-06 17:00:00\",\n      \"start_date_display\": \"15:00\",\n      \"end_date_display\": \"17:00\",\n      \"start_dateUTC\": \"2023-02-06 20:00:00\",\n      \"end_dateUTC\": \"2023-02-06 22:00:00\",\n      \"available\": false\n    }\n  ],\n  \"has_more\": false,\n  \"no_appt_available\": true,\n  \"time_zone\": \"US/Eastern\",\n  \"time_zone_display_value\": \"US/Eastern\",\n  \"next_available_slot\": {\n    \"start_date\": \"2023-02-10 13:00:00\",\n    \"end_date\": \"2023-02-10 15:00:00\",\n    \"start_date_display\": \"13:00\",\n    \"end_date_display\": \"15:00\",\n    \"start_dateUTC\": \"2023-02-10 18:00:00\",\n    \"end_dateUTC\": \"2023-02-10 20:00:00\",\n    \"available\": true\n}\n```\n\n"}}