---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Appointment Open API

# Appointment Open API {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 24 minutes to read

The Appointment Open API is a telecommunication API that allows you to interact with the appointment booking application. Use this API to book appointments and search available time slots.
The Appointment Open API is a ServiceNow® implementation of the Open API TMForum TMF646 Appointment REST API specification and is conformance certified by TM Forum. This implementation is based on [TMF646 Appointment API REST Specification R16.0.1](https://www.tmforum.org/resources/specification/tmf646-appointment-api-rest-specification-r16-0-1/).  
This API requires the following plugins available on the ServiceNow Store.

* Appointment Booking (com.snc.appointment_booking)
* Field Service Management (com.snc.work_management)
* Field Service Management for Telecommunications (com.sn_fsmt)
* Telecommunication Open APIs (com.sn_tmf_api)
{#appointment-open-api__ul_s3w_yrb_tcc}

Before using this API, Appointment Booking Configuration and Service Configuration must be set up. In addition, a task for which the appointment is being booked must exist.

This API is provided within the
`sn_tmf_api` namespace. The calling user must have the sn_tmf_api.appointment_integrator role.

## Appointment Open - GET /api/sn_tmf_api/appointment/appointment {#ariaid-title2}

Retrieves a list of appointment records.

### URL format

Default URL: /api/sn_tmf_api/appointment/appointment

### Supported request parameters

{#apptOpen-GET-appointment__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 1. Path parameters]

{#apptOpen-GET-appointment__id_akz_31d_tcc__entry__2}{#apptOpen-GET-appointment__query-row-category}{#apptOpen-GET-appointment__query-row-relatedEntity}{#apptOpen-GET-appointment__query-row-relatedEntity.id}{#apptOpen-GET-appointment__query-row-relatedParty}{#apptOpen-GET-appointment__query-row-relatedParty.id}{#apptOpen-GET-appointment__query-row-relatedParty.name}{#apptOpen-GET-appointment__query-row-relatedPlace}{#apptOpen-GET-appointment__query-row-relatedPlace.id}{#apptOpen-GET-appointment__query-row-validFor}{#apptOpen-GET-appointment__query-row-validFor.endDateTime}{#apptOpen-GET-appointment__query-row-validFor.startDateTime}

| Name | Description |
|-|-|
| category | Filter the appointment by category sys_id. Data type: String Table: Location \[cmn_location\] Default: Returns all appointments if category sys_id is not provided. |
| relatedEntity | Details about the related entity associated with the work order. Data type: Object "relatedEntity": { "id": "String" } |
| relatedEntity.id | Required. Sys_id of the related entity. Data type: String Table: workOrder \[wm_order\] Default: Returns all if sys_id is not provided. |
| relatedParty | Filter the appointment by the sys_id of the related party associated with the appointment. Data type: Object "relatedParty": { "id": "String", "name": "String" } Default: Returns all appointments if relatedParty is not provided. |
| relatedParty.id | Sys_id of the related party. Data type: String Table: User \[sys_user\] |
| relatedParty.name | Name of the related party. Data type: String |
| relatedPlace | Filter the appointment by the place where the service or repair is scheduled to happen. Data type: Object "relatedPlace": { "id": "String" } Default: Returns all appointments if relatedPlace is not provided. |
| relatedPlace.id | Sys_id of the related place. Data type: String Table: Location \[cmn_location\] |
| validFor | Filter the appointment by a date range that the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } Default: Returns all appointments if validFor is not provided. |
| validFor.endDateTime | End date and time of the appointment. Only appointments with the specified end date and time are returned in the response. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. Table: Location \[cmn_location\] |
| validFor.startDateTime | Start date and time of the appointment. Only appointments with the specified start date and time are returned in the response. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. Table: Location \[cmn_location\] |
[Table 2. Query parameters]

{#apptOpen-GET-appointment__id_akz_31d_tcc} {#apptOpen-GET-appointment__entry__30}

| Name | Description |
|-|-|
| None |   |
[Table 3. Request body parameters (XML or JSON)]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-GET-appointment__entry__34}{#apptOpen-GET-appointment__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 4. Request headers]

{#apptOpen-GET-appointment__entry__38}{#apptOpen-GET-appointment__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 5. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-GET-appointment__entry__42}{#apptOpen-GET-appointment__entry-200-status-code}{#apptOpen-GET-appointment__entry-400-status-code}{#apptOpen-GET-appointment__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 6. Status codes]

### Response body parameters (JSON or XML)

{#apptOpen-GET-appointment__table_g3p_tyd_wcc__entry__2}

| Name | Description |
|-|-|
| category | Sys_id of the record producer configured for the appointment booking service configuration. Data type: String Stored in: Catalog Item  field of the Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table. |
| creationDate | Date and time that the appointment was created. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| href | Hyperlink to the appointment record. Use this link in another Appointment Open API request to reschedule or delete the appointment. Data type: String |
| id | Sys_id of the appointment. Data type: String Stored in: Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table |
| lastUpdate | Date and time the appointment was last updated. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| relatedEntity | Details about the related entity of the appointment. Data type: Array of Objects "relatedEntity": [ { "@referredType": "String", "id": "String", "role": "String" } ] |
| relatedEntity.@referredType | Type of item or service. Data type: String Stored in: workOrder \[wm_order\] table |
| relatedEntity.id | Sys_id of the related entity. Data type: String Stored in: workOrder \[wm_order\] table |
| relatedEntity.role | Role description of the related entity. Possible value: work order Data type: String Stored in: workOrder \[wm_order\] table |
| relatedParty | List of contacts for the appointment. Each contact is an object in the array. Data type: Array of Objects "relatedParty": [ { "@referredType": "String", "id": "String", "name": " String", "role": "String" } ] |
| relatedParty.@referredType | Type of customer. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.id | Sys_id of the customer contact associated with the work order. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.name | Name of the customer contact. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.role | Role of the customer contact. Possible values: * customer: The contact has a customer role. * technician: The contact has a technician role. {#apptOpen-GET-appointment__ul_glf_1sn_zcc} Data type: String Stored in: Contact \[customer_contact\] table |
| relatedPlace | Location details of the associated appointment. Data type: Object "relatedPlace": { "@referredType": "String", "id": "String", "name": "String", "role": "String" } |
| relatedPlace.@referredType | Geographic address of the appointment. Possible value: GeographicLocation. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.id | Sys_id of the location. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.name | Name of the location related to the contact. For example, 100 South Charles Street, Baltimore, MD. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.role | Role of the appointment location as an intervention address. Possible value: InterventionAddress Data type: String Stored in: Location \[cmn_location\] table |
| validFor | Date range that the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String" "startDateTime": "String" } |
| validFor.endDateTime | End date and time of the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| validFor.startDateTime | Start date and time of the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
[ ]

{#apptOpen-GET-appointment__table_g3p_tyd_wcc}  

### cURL request

The following example shows how to return a list of appointments using the GET appointment method.

    curl "http://instance.servicenow.com/api/sn_tmf_api/appointment/appointment" \ 
    --request GET\ 
    --user 'username':'password' 

The response body contains the details of two different appointments configured in the appointment booking service configuration:

    [
      {
        "id": "201071ad4f80d210f8992fec52ce0ba9",
        "href": "api/sn_tmf_api/appointment/appointment/201071ad4f80d210f8992fec52ce0ba9",
        "validFor": {
          "startDateTime": "2024-08-16 17:00:00",
          "endDateTime": "2024-08-16 19:00:00"
        },
        "category": "4a34a64d4f4c1210f8992fec52ce0b63",
        "relatedParty": [
          {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": " null",
            "role": "customer",
            "@referredType": "Individual"
          }
        ],
        "relatedPlace": {
          "id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
          "name": "100 South Charles Street, Baltimore,MD",
          "role": "interventionAddress",
          "@referredType": "Individual"
        },
        "relatedEntity": [
          {
            "id": "b440a5694f40d210f8992fec52ce0ba3",
            "role": "work order",
            "@referredType": "WorkOrder"
          }
        ],
        "creationDate": "2024-08-16 00:39:22",
        "lastUpdate": "2024-08-16 00:39:22"
      },
      {
        "id": "25c012c07f5c5610f8994fa63c866523",
        "href": "api/sn_tmf_api/appointment/appointment/25c012c07f5c5610f8994fa63c866523",
        "validFor": {
          "startDateTime": "2024-08-26 17:00:00",
          "endDateTime": "2024-08-26 19:00:00"
        },
        "category": "4a34a64d4f4c1210f8992fec52ce0b63",
        "relatedParty": [
          {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": " null",
            "role": "customer",
            "@referredType": "Individual"
          }
        ],
        "relatedPlace": {
          "id": "f48b21850a0a0ba7004182b18099696d",
          "name": "11251 Rancho Carmel Drive, San Diego,CA",
          "role": "interventionAddress",
          "@referredType": "Individual"
        },
        "relatedEntity": [
          {
            "id": "c0b09a047f109610f8994fa63c8665b4",
            "role": "work order",
            "@referredType": "WorkOrder"
          }
        ],
        "creationDate": "2024-08-23 22:18:43",
        "lastUpdate": "2024-08-23 22:18:43"
      }
    ]

## Appointment Open - GET /api/sn_tmf_api/appointment/appointment/{id} {#ariaid-title3}

Retrieves an appointment record associated with a specified ID.

### URL format

Default URL: /api/sn_tmf_api/appointment/appointment/{id}

### Supported request parameters

{#apptOpen-GET-appointment-id__entry__2}

| Name | Description |
|-|-|
| id | Sys_id of the appointment to retrieve. Data type: String Table: Appointment booking \[sn_apptmnt_booking_appointment_booking\] |
[Table 7. Path parameters]

{#apptOpen-GET-appointment-id__id_g4x_4zc_tcc__entry__2}{#apptOpen-GET-appointment-id__query-row-category}{#apptOpen-GET-appointment-id__query-row-relatedEntity}{#apptOpen-GET-appointment-id__query-row-relatedEntity.id}{#apptOpen-GET-appointment-id__query-row-relatedParty}{#apptOpen-GET-appointment-id__query-row-relatedParty.id}{#apptOpen-GET-appointment-id__query-row-relatedParty.name}{#apptOpen-GET-appointment-id__query-row-relatedPlace}{#apptOpen-GET-appointment-id__query-row-relatedPlace.id}{#apptOpen-GET-appointment-id__query-row-validFor}{#apptOpen-GET-appointment-id__query-row-validFor.endDateTime}{#apptOpen-GET-appointment-id__query-row-validFor.startDateTime}

| Name | Description |
|-|-|
| category | Filter the appointment by category sys_id. Data type: String Table: Location \[cmn_location\] Default: Returns all appointments if category sys_id is not provided. |
| relatedEntity | Details about the related entity associated with the work order. Data type: Object "relatedEntity": { "id": "String" } |
| relatedEntity.id | Required. Sys_id of the related entity. Data type: String Table: workOrder \[wm_order\] Default: Returns all if sys_id is not provided. |
| relatedParty | Filter the appointment by the sys_id of the related party associated with the appointment. Data type: Object "relatedParty": { "id": "String", "name": "String" } Default: Returns all appointments if relatedParty is not provided. |
| relatedParty.id | Sys_id of the related party. Data type: String Table: User \[sys_user\] |
| relatedParty.name | Name of the related party. Data type: String |
| relatedPlace | Filter the appointment by the place where the service or repair is scheduled to happen. Data type: Object "relatedPlace": { "id": "String" } Default: Returns all appointments if relatedPlace is not provided. |
| relatedPlace.id | Sys_id of the related place. Data type: String Table: Location \[cmn_location\] |
| validFor | Filter the appointment by a date range that the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } Default: Returns all appointments if validFor is not provided. |
| validFor.endDateTime | End date and time of the appointment. Only appointments with the specified end date and time are returned in the response. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. Table: Location \[cmn_location\] |
| validFor.startDateTime | Start date and time of the appointment. Only appointments with the specified start date and time are returned in the response. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. Table: Location \[cmn_location\] |
[Table 8. Query parameters]

{#apptOpen-GET-appointment-id__id_g4x_4zc_tcc} {#apptOpen-GET-appointment-id__entry__30}

| Name | Description |
|-|-|
| None |   |
[Table 9. Request body parameters (XML or JSON)]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-GET-appointment-id__entry__34}{#apptOpen-GET-appointment-id__accept-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Only supports application/json. |
[Table 10. Request headers]

{#apptOpen-GET-appointment-id__entry__38}{#apptOpen-GET-appointment-id__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 11. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-GET-appointment-id__entry__42}{#apptOpen-GET-appointment-id__entry-200-status-code}{#apptOpen-GET-appointment-id__entry-400-status-code}{#apptOpen-GET-appointment-id__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 12. Status codes]

### Response body parameters {#apptOpen-GET-appointment-id__section_xbf_bwd_wcc}

{#apptOpen-GET-appointment-id__table_ybf_bwd_wcc__entry__2}

| Name | Description |
|-|-|
| category | Sys_id of the record producer configured for the appointment booking service configuration. Data type: String Stored in: Catalog Item  field of the Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table. |
| creationDate | Date and time that the appointment was created. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| href | Hyperlink to the appointment record. Use this link in another Appointment Open API request to reschedule or delete the appointment. Data type: String |
| id | Sys_id of the appointment. Data type: String Stored in: Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table |
| lastUpdate | Date and time the appointment was last updated. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| relatedEntity | Details about the related entity of the appointment. Data type: Array of Objects "relatedEntity": [ { "@referredType": "String", "id": "String", "role": "String" } ] |
| relatedEntity.@referredType | Type of item or service. Data type: String Stored in: workOrder \[wm_order\] table |
| relatedEntity.id | Sys_id of the related entity. Data type: String Stored in: workOrder \[wm_order\] table |
| relatedEntity.role | Role description of the related entity. Possible value: work order Data type: String Stored in: workOrder \[wm_order\] table |
| relatedParty | List of contacts for the appointment. Each contact is an object in the array. Data type: Array of Objects "relatedParty": [ { "@referredType": "String", "id": "String", "name": " String", "role": "String" } ] |
| relatedParty.@referredType | Type of customer. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.id | Sys_id of the customer contact associated with the work order. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.name | Name of the customer contact. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.role | Role of the customer contact. Possible values: * customer: The contact has a customer role. * technician: The contact has a technician role. {#apptOpen-GET-appointment-id__ul_glf_1sn_zcc} Data type: String Stored in: Contact \[customer_contact\] table |
| relatedPlace | Location details of the associated appointment. Data type: Object "relatedPlace": { "@referredType": "String", "id": "String", "name": "String", "role": "String" } |
| relatedPlace.@referredType | Geographic address of the appointment. Possible value: GeographicLocation. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.id | Sys_id of the location. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.name | Name of the location related to the contact. For example, 100 South Charles Street, Baltimore, MD. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.role | Role of the appointment location as an intervention address. Possible value: InterventionAddress Data type: String Stored in: Location \[cmn_location\] table |
| validFor | Date range that the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String" "startDateTime": "String" } |
| validFor.endDateTime | End date and time of the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| validFor.startDateTime | Start date and time of the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
[ ]

{#apptOpen-GET-appointment-id__table_ybf_bwd_wcc}  

### cURL request

The following example returns appointment details according to the given appointment record ID.

    curl "http://instance.servicenow.com/api/sn_tmf_api/appointment/appointment/201071ad4f80d210f8992fec52ce0ba9" \ 
    --request GET\ 
    --user 'username':'password'

Response body:

    [
      {
        "id": "201071ad4f80d210f8992fec52ce0ba9",
        "href": "api/sn_tmf_api/appointment/appointment/201071ad4f80d210f8992fec52ce0ba9",
        "validFor": {
          "startDateTime": "2024-08-16 17:00:00",
          "endDateTime": "2024-08-16 19:00:00"
        },
        "category": "4a34a64d4f4c1210f8992fec52ce0b63",
        "relatedParty": [
          {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": " null",
            "role": "customer",
            "@referredType": "Individual"
          }
        ],
        "relatedPlace": {
          "id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
          "name": "100 South Charles Street, Baltimore,MD",
          "role": "interventionAddress",
          "@referredType": "Individual"
        },
        "relatedEntity": [
          {
            "id": "b440a5694f40d210f8992fec52ce0ba3",
            "role": "work order",
            "@referredType": "WorkOrder"
          }
        ],
        "creationDate": "2024-08-16 00:39:22",
        "lastUpdate": "2024-08-16 00:39:22"
      }
    ]

## Appointment Open - GET /api/sn_tmf_api/appointment/searchTimeSlot {#ariaid-title4}

Returns time slots that were configured in the appointment booking service configuration along with their availability.

### URL format

/api/sn_tmf_api/appointment/searchTimeSlot

### Supported request parameters

{#apptOpen-GET-searchTimeSlot__table_fb3_nwt_dcc__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 13. Path parameters]

{#apptOpen-GET-searchTimeSlot__table_fb3_nwt_dcc} {#apptOpen-GET-searchTimeSlot__entry__6}{#apptOpen-GET-searchTimeSlot__serviceTest-response-testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime}{#apptOpen-GET-searchTimeSlot__serviceTest-response-testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime}

| Name | Description |
|-|-|
| catalog_id | Required. Sys_id of the record producer configured with an appointment booking service configuration. Data type: String Table: Record Producer \[sc_cat_item_producer\] |
| end_date | Required. End date and time of the time period in which you want to search for the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 12:00:00`. |
| location | Sys_id of the appointment's location. Table: Location \[cmn_location\] Data type: String Default: Returns all locations if not specified. |
| opened_for | Required. Sys_id of the user for whom the appointment is being booked. Table: Contact \[customer_contact\] Data type: String |
| start_date | Required. Start date and time of the time period in which you want to search for the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:00:00`. |
[Table 14. Query parameters]

{#apptOpen-GET-searchTimeSlot__entry__18}

| Name | Description |
|-|-|
| None |   |
[Table 15. Request body parameters]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-GET-searchTimeSlot__entry__22}{#apptOpen-GET-searchTimeSlot__accept-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Only supports application/json. |
[Table 16. Request headers]

{#apptOpen-GET-searchTimeSlot__entry__26}

| Header | Description |
|-|-|
| None |   |
[Table 17. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-GET-searchTimeSlot__entry__30}{#apptOpen-GET-searchTimeSlot__entry-200-status-code}{#apptOpen-GET-searchTimeSlot__entry-400-status-code}{#apptOpen-GET-searchTimeSlot__entry-500-status-code}

| 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. |
[Table 18. Status codes]

### Response body parameters

{#apptOpen-GET-searchTimeSlot__entry__38}

| Name | Description |
|-|-|
| availableTimeSlot | List of appointment slots within the specified block of time requested. Data type: Array of Objects 'availableTimeSlot': [ { "available": Boolean, "end_date": "String", "end_date_display": "String", "end_dateUTC": "String", "start_date": "String", "start_date_display": "String", "start_dateUTC": "String" } ] |
| availableTimeSlot.available | Flag that indicates whether the associated time slot is available. Possible values: * true: Time slot is available. * false: Time slot is unavailable. {#apptOpen-GET-searchTimeSlot__ul_nf5_mvb_2cc} Data type: Boolean |
| availableTimeSlot.end_date | End date and time of the associated appointment. The time zone is based on the value in the timeZone parameter. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| availableTimeSlot.end_date_display | Display end date and time of the associated appointment. The time zone is based on the value in the timeZone parameter. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| availableTimeSlot.end_dateUTC | End date and time of the associated appointment. Data type: String Format: UTC |
| availableTimeSlot.start_date | Start date and time of the associated appointment. Reflects the value of the timeZone parameter. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| availableTimeSlot.start_date_display | Display start date and time of the associated appointment. Reflects the value of the timeZone parameter. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| availableTimeSlot.start_dateUTC | Start date and time of the associated appointment. Data type: String Format: UTC |
| hasMore | Flag that indicates whether there are more appointment slots to fetch after returning the limit. The limit is specified in the Appointment Booking property, sn_apptmnt_booking.max_appointments_returned (Default: 100). See [Appointment booking components](https://www.servicenow.com/docs/access?context=appointment-booking-components&version=xanadu&pubname=xanadu-field-service-management&ft:locale=en-US) for more details about this property. Possible values: * true: More appointment slots can be fetched. * false: No more appointment slots are available. {#apptOpen-GET-searchTimeSlot__ul_rqd_bwb_2cc} Data type: Boolean |
| noApptAvailable | Flag that indicates whether there are more appointment slots available for the specified date and time. Valid values: * true: More appointment slots are available for the specified date and time. * false: No more appointment slots are available for the specified date and time. {#apptOpen-GET-searchTimeSlot__ul_jc4_cwb_2cc} Data type: Boolean |
| searchResult | Results for appointment availability within the designated search time slot. Possible values: * success * fail {#apptOpen-GET-searchTimeSlot__ul_vkp_jzb_2cc} Data type: String |
| status | Completion status of the search for available time slots. For example, done. Data type: String |
| timeZone | Time zone used when booking or updating the specified appointment slot. Date type: String Format: Country/city or area format, such as US/Eastern |
[ ]

### cURL request

The following code example shows how to call this endpoint.

    curl --location --request GET 'https://instance.service-now.com/api/sn_tmf_api/appointment/searchTimeSlot?
    start_date=2024-07-10 09:00:00&end_date=2024-07-20 23:00:00&catalog_id=ada50a93f0220210f8776517d8c8e776&
    opened_for=51670151c35420105252716b7d40ddfe&location=f48b21850a0a0ba7004182b18099696d ' \
    --user 'username':'password'

Result:

    {
      "searchResult": "success",
      "status": "done",
      "availableTimeSlot": [
        {
          "start_date": "2024-07-10 09:00:00",
          "end_date": "2024-07-10 12:00:00",
          "start_date_display": "09:00",
          "end_date_display": "12:00",
          "start_dateUTC": "2024-07-10 16:00:00",
          "end_dateUTC": "2024-07-10 19:00:00",
          "available": false
        },
        {
          "start_date": "2024-07-11 13:00:00",
          "end_date": "2024-07-11 16:00:00",
          "start_date_display": "13:00",
          "end_date_display": "16:00",
          "start_dateUTC": "2024-07-11 20:00:00",
          "end_dateUTC": "2024-07-11 23:00:00",
          "available": true
        },
        {
          "start_date": "2024-07-12 09:00:00",
          "end_date": "2024-07-12 12:00:00",
          "start_date_display": "09:00",
          "end_date_display": "12:00",
          "start_dateUTC": "2024-07-12 16:00:00",
          "end_dateUTC": "2024-07-12 19:00:00",
          "available": true
        },
        {
          "start_date": "2024-07-12 13:00:00",
          "end_date": "2024-07-12 16:00:00",
          "start_date_display": "13:00",
          "end_date_display": "16:00",
          "start_dateUTC": "2024-07-12 20:00:00",
          "end_dateUTC": "2024-07-12 23:00:00",
          "available": true
        },
        {
          "start_date": "2024-07-19 13:00:00",
          "end_date": "2024-07-19 16:00:00",
          "start_date_display": "13:00",
          "end_date_display": "16:00",
          "start_dateUTC": "2024-07-19 20:00:00",
          "end_dateUTC": "2024-07-19 23:00:00",
          "available": true
        }
      ],
      "hasMore": false,
      "noApptAvailable": false,
      "timeZone": "US/Arizona"
    }

## Appointment Open - DELETE /api/sn_tmf_api/appointment/appointment/{id} {#ariaid-title5}

Deletes an appointment record with a given ID.

### URL format

Default URL: /api/sn_tmf_api/appointment/appointment/{id}

### Supported request parameters

{#apptOpen-DELETE-appointment__entry__2}

| Name | Description |
|-|-|
| id | Sys_id of the appointment record to delete. Data type: String Table: Appointment booking \[sn_apptmnt_booking_appointment_booking\] |
[Table 19. Path parameters]

{#apptOpen-DELETE-appointment__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 20. Query parameters]

{#apptOpen-DELETE-appointment__entry__10}

| Name | Description |
|-|-|
| None |   |
[Table 21. Request body parameters (XML or JSON)]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-DELETE-appointment__entry__14}{#apptOpen-DELETE-appointment__accept-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Only supports application/json. |
[Table 22. Request headers]

{#apptOpen-DELETE-appointment__entry__18}{#apptOpen-DELETE-appointment__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 23. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-DELETE-appointment__entry__22}{#apptOpen-DELETE-appointment__entry-200-status-code}{#apptOpen-DELETE-appointment__entry-400-status-code}{#apptOpen-DELETE-appointment__entry-404-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
[Table 24. Status codes]

### Response body parameters (JSON)

{#apptOpen-DELETE-appointment__entry__30}

| Name | Description |
|-|-|
| message | Response message acknowledging successful deletion. Success: "The appointment (\<id\>) is successfully cancelled." Errors: * "Appointment cancellation failed.": The ID can't be found in the system and returns a 404 status code. * "Appointment cancellation failed.": The appointment is already in a cancelled or completed state or can't be deleted, and returns a 404 status code. * "The appointment (\<id\>) can't be cancelled as it is beyond the Cancel by time.": The appointment is already beyond the 'cancel by time', which is configured in the appointment booking service configuration. Returns a 400 status code. {#apptOpen-DELETE-appointment__ul_zsv_1nn_zcc} Data type: String |
[ ]

### cURL request

The following example deletes an appointment with a specific ID.

    curl "http://instance.servicenow.com/api/sn_tmf_api/appointment/appointment/68cc0a5a9314521060320dd548373" \ 
    --request GET\ 
    --user 'username':'password' 

Response body:

    "The appointment (68cc0a5a9314521060320dd548373cbd) is successfully cancelled."

## Appointment Open - PATCH /api/sn_tmf_api/appointment/appointment/{id} {#ariaid-title6}

Reschedule appointments with a given ID for a  work order.

### URL format

Default URL: PATCH /api/sn_tmf_api/appointment/appointment/{id}

### Supported request parameters

{#apptOpen-PATCH-appointment-id__entry__2}

| Name | Description |
|-|-|
| id | Sys_id of the appointment to reschedule. Data type: String Table: Appointment booking \[sn_apptmnt_booking_appointment_booking\] |
[Table 25. Path parameters]

{#apptOpen-PATCH-appointment-id__table_dhx_bld_tcc__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 26. Query parameters]

{#apptOpen-PATCH-appointment-id__table_dhx_bld_tcc} {#apptOpen-PATCH-appointment-id__entry__10}

| Name | Description |
|-|-|
| note | If canceling the appointment, you can add work notes here. Updates the work notes of the work order and the message of the appointment. Data type: Array of Objects "note": [ { "author": "String", "date": "String", "text": "String" } ] Stored in: Appointment Booking \[sn_apptmnt_booking_appointment_booking\] table |
| note.author | Name of the person who writing the note. Data type: String |
| note.date | Date and time that the note was published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2018-02-04T11:00:18.071Z. |
| note.text | Descriptive text about the work order that is attached to the appointment. For example, updates on the work order's progress. Data type: String |
| status | Status of the appointment. Valid values: * cancelled: The appointment reschedule is cancelled. * completed: The rescheduled appointment is completed. * confirmed: The appointment reschedule is accepted and booked. * new: The appointment rescheduling request was recently created. * pending: The appointment reschedule is pending. * ready: The appointment reschedule is requested. {#apptOpen-PATCH-appointment-id__ul_tfz_j4n_zcc} Data type: String |
| validFor | Filter the appointment by a date range that the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } Default: Returns all appointments if validFor is not provided. |
| validFor.endDateTime | End date and time of the appointment. Only appointments with the specified end date and time are returned in the response. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. Table: Location \[cmn_location\] |
| validFor.startDateTime | Start date and time of the appointment. Only appointments with the specified start date and time are returned in the response. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. Table: Location \[cmn_location\] |
[Table 27. Request body parameters (JSON)]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-PATCH-appointment-id__entry__28}{#apptOpen-PATCH-appointment-id__accept-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Only supports application/json. |
[Table 28. Request headers]

{#apptOpen-PATCH-appointment-id__entry__32}{#apptOpen-PATCH-appointment-id__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 29. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-PATCH-appointment-id__entry__36}{#apptOpen-PATCH-appointment-id__entry-200-status-code}{#apptOpen-PATCH-appointment-id__entry-500-status-code}

| 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. |
[Table 30. Status codes]

### Response body parameters (JSON)

{#apptOpen-PATCH-appointment-id__entry__42}

| Name | Description |
|-|-|
| creationDate | Date and time that the appointment was created. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| href | Unique reference link of the appointment. You can use this link in another request to get an appointment. Data type: String |
| id | Sys_id of the appointment that was rescheduled. Data type: String Stored in: Appointment booking \[sn_apptmnt_booking_appointment_booking\] table |
| lastUpdate | Date and time the appointment was last updated. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| reason | Purpose for updating the appointment. Possible values: * "Appointment rescheduled.": The PATCH method was used to reschedule the appointment. * "The appointment (id) is successfully cancelled.": The PATCH method was used to cancel the appointment. {#apptOpen-PATCH-appointment-id__ul_ok4_mqn_zcc} Data type: String |
| relatedParty | Customer details of the associated appointment. Data type: Array of Objects "relatedParty": [ { "@referredType": "String", "id": "String", "name": "String", "role": "String" } ] |
| relatedParty.id | Sys_id of the customer contact. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.name | Name of the customer contact. Data type: String |
| relatedPlace.@referredType | Type of customer. Data type: String Only possible value: Individual |
| relatedParty.role | Role of the contact. Data type: String Only possible value: Contact |
| success | Flag that indicates whether the request was successful. Possible values: * true: The appointment was successfully rescheduled. * false: The appointment couldn't be rescheduled. {#apptOpen-PATCH-appointment-id__ul_ijf_n2f_zcc} Data type: Boolean |
[ ]

### cURL request

The following example demonstrates how to use a PATCH method to reschedule an appointment with a given ID.

    curl -X POST 'https://instance.service-now.com/api/sn_tmf_api/appointment/appointment/68cc0a5a9314521060320dd548373cbd ' \ 
    -H "Accept: application/json" \ 
    -H "Content-Type: application/json" \ 
    -u "username":"password" \ 
    -data {
      "validFor": { 
          "startDateTime": "2024-07-30 00:0:00", 
          "endDateTime": "2024-08-30 00:00:00" 
                  }
      "note": {
          "date": "85388c25b71011104eed4643ae11a993",
          "author": "Sarah Johnson",
          "text": "customer"
        }
      "state": "active"
       }
      ]
    }

The response body shows a success message that the appointment was rescheduled.

    {
      "relatedParty": [
        {
          "id": "85388c25b71011104eed4643ae11a993",
          "name": "Sarah Johnson",
          "role": "customer",
          "@referredType": "Individual"
        }
      ],
      "success": true,
      "reason": "Appointment rescheduled!",
      "id": "68cc0a5a9314521060320dd548373cbd",
      "href": "api/sn_tmf_api/appointment/appointment/68cc0a5a9314521060320dd548373cbd",
      "creationDate": "2024-08-30 20:56:54",
      "lastUpdate": "2024-08-30 20:56:54"
    }

## Appointment Open - POST /api/sn_tmf_api/appointment/appointment {#ariaid-title7}

Enables you to book appointments for a work order.

### URL format

/api/sn_tmf_api/appointment/appointment

### Supported request parameters

{#apptOpen-POST-appointment__table_lr2_mwt_dcc__entry__2}

| Name | Description |
|-|-|
| None |   |
[Table 31. Path parameters]

{#apptOpen-POST-appointment__table_lr2_mwt_dcc} {#apptOpen-POST-appointment__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 32. Query parameters]

{#apptOpen-POST-appointment__entry__10}{#apptOpen-POST-appointment__serviceTest-response-testMeasureDefinition.thresholdRule.consequence.validFor}{#apptOpen-POST-appointment__serviceTest-response-testMeasureDefinition.thresholdRule.consequence.validFor.endDateTime}{#apptOpen-POST-appointment__serviceTest-response-testMeasureDefinition.thresholdRule.consequence.validFor.startDateTime}

| Name | Description |
|-|-|
| category | Required. Sys_id of the record producer configured for the appointment booking service configuration. Data type: String Table: In the Catalog Item field of the Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table. |
| relatedEntity | Required. List of impacted work orders to associate with the appointment. Data type: Array of Objects "relatedEntity": [ { "@referredType": "String" "id": "String", } ] |
| relatedEntity.@referredType | Required. Type of item or service. Only valid value: WorkOrder Data type: String Table: Work Order \[wm_order\] |
| relatedEntity.id | Required. Sys_id of the related entity. Data type: String Table: workOrder \[wm_order\] Default: Returns all if sys_id is not provided. |
| relatedEntity.role | Required. Role description of the related entity. Only valid value: work order Data type: String Table: Work Order \[wm_order\] |
| relatedParty | Required. List of contacts for the appointment. Each contact is an object in the array. The request must list at least one item which contains customer account information. Data type: Array of Objects "relatedParty": [ { "@referredType": "String", "id": "String", "name": "String", "role": "String" } ] |
| relatedParty.@referredType | Type of customer. Only valid value: Individual Data type: String |
| relatedParty.id | Required. Sys_id or external_id of the contact associated with the work order. Data type: String Table: Contact \[customer_contact\] |
| relatedParty.name | Name of the contact. Data type: String Table: Contact \[customer_contact\] |
| relatedParty.role | Required. Role of the contact. Possible values: * customer: The contact has a customer role. * technician: The contact has a technician role. {#apptOpen-POST-appointment__ul_glf_1sn_zcc} Data type: String Table: Contact \[customer_contact\] |
| relatedPlace | Required. List of the locations related to the appointment. Data type: Array of Objects "relatedPlace": [ { "@referredType": "String", "id": "String", "name": "String", "role": "String" } ] |
| relatedPlace.@referredType | Required. Type of location. For example, City. Data type: String Table: Locations \[cmn_location\] |
| relatedPlace.id | Required. Sys_id of the related location. Data type: String Table: Locations \[cmn_location\] |
| relatedPlace.name | Name of the location related to the contact. For example, 251 Reddy St, Darwin, CA 93522. Data type: String Table: Locations \[cmn_location\] |
| relatedPlace.role | Required. Description of the location role. For example, work order. Data type: String |
| timeZone | Required. Time zone to use when booking the specified appointment slot. Date type: String Format: Country/city or area format, such as US/Eastern |
| validFor | Required. Date range the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String", "startDateTime": "String" } |
| validFor.endDateTime | Required. End date and time of the time slot. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| validFor.startDateTime | Required. Start date and time of the time slot. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
[Table 33. Request body parameters]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-POST-appointment__entry__50}{#apptOpen-POST-appointment__accept-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Only supports application/json. |
[Table 34. Request headers]

{#apptOpen-POST-appointment__entry__54}{#apptOpen-POST-appointment__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 35. Response headers]

### 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](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#apptOpen-POST-appointment__entry__58}{#apptOpen-POST-appointment__entry-200-status-code}{#apptOpen-POST-appointment__entry-500-status-code}

| 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. |
[Table 36. Status codes]

### Response body parameters

{#apptOpen-POST-appointment__entry__64}

| Name | Description |
|-|-|
| category | Sys_id of the record producer configured for the appointment booking service configuration. Data type: String Stored in: Catalog Item field of the Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table. |
| creationDate | Date and time that the appointment was created. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| href | Hyperlink to the appointment record. Use this link in another Appointment Open API request to reschedule or delete the appointment. Data type: String |
| id | Sys_id of the appointment. Data type: String Stored in: Appointment Booking Service Configuration \[sn_apptmnt_booking_service_config\] table |
| lastUpdate | Date and time the appointment was last updated. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| relatedEntity | Details about the related entity of the appointment. Data type: Array of Objects "relatedEntity": [ { "@referredType": "String", "id": "String", "role": "String" } ] |
| relatedEntity.@referredType | Type of item or service. Data type: String Stored in: workOrder \[wm_order\] table |
| relatedEntity.id | Sys_id of the related entity. Data type: String Stored in: workOrder \[wm_order\] table |
| relatedEntity.role | Role description of the related entity. Possible value: work order Data type: String Stored in: workOrder \[wm_order\] table |
| relatedParty | List of contacts for the appointment. Each contact is an object in the array. Data type: Array of Objects "relatedParty": [ { "@referredType": "String", "id": "String", "name": " String", "role": "String" } ] |
| relatedParty.@referredType | Type of customer. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.id | Sys_id of the customer contact associated with the work order. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.name | Name of the customer contact. Data type: String Stored in: Contact \[customer_contact\] table |
| relatedParty.role | Role of the customer contact. Possible values: * customer: The contact has a customer role. * technician: The contact has a technician role. {#apptOpen-POST-appointment__d4872e427} Data type: String Stored in: Contact \[customer_contact\] table |
| relatedPlace | Location details of the associated appointment. Data type: Object "relatedPlace": { "@referredType": "String", "id": "String", "name": "String", "role": "String" } |
| relatedPlace.@referredType | Geographic address of the appointment. Possible value: GeographicLocation. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.id | Sys_id of the location. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.name | Name of the location related to the contact. For example, 100 South Charles Street, Baltimore, MD. Data type: String Stored in: Location \[cmn_location\] table |
| relatedPlace.role | Role of the appointment location as an intervention address. Possible value: InterventionAddress Data type: String Stored in: Location \[cmn_location\] table |
| success | Flag that indicates whether the request was successful. Possible values: * true: Request succeeded. * false: Request failed. {#apptOpen-POST-appointment__ul_p5j_gnj_hdc} Data type: Boolean |
| timeZone | Time zone used when booking or updating the specified appointment slot. Date type: String Format: Country/city or area format, such as US/Eastern |
| validFor | Date range that the appointment is valid for. Data type: Object "validFor": { "endDateTime": "String" "startDateTime": "String" } |
| validFor.endDateTime | End date and time of the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
| validFor.startDateTime | Start date and time of the appointment. Data type: String Format: YYYY-MM-DD 00:00:00. For example, 2025-01-31 09:35:43. |
[ ]

### cURL request

The following example shows how to create a new appointment booking.

    curl "https://instance.servicenow.com/api/sn_tmf_api/appointment/appointment" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
      \"validFor\": {
        \"startDateTime\": \"2024-08-19 09:00:00\",
        \"endDateTime\": \"2024-08-19 11:00:00\"
      },
      \"category\": \"e4c1116b3b810300ce8a4d72f3efc40f\",
      \"relatedParty\": [
        {
          \"id\": \"eaf68911c35420105252716b7d40ddde\",
          \"name\": \"Sally Thomas\",
          \"role\": \"customer\",
          \"@referredType\": \"Individual\"
        }
      ],
      \"relatedPlace\": {
        \"id\": \"25ab9c4d0a0a0bb300f7dabdc0ca7c1c\",
        \"name\": \"100 South Charles Street, Baltimore,MD\",
        \"role\": \"interventionAddress\",
        \"@referredType\": \"GeographicAddress\"
      },
      \"relatedEntity\": [
        {
          \"id\": \"48dbfbf9201f0250f877303e8a020dcd\",
          \"role\": \"work order\",
          \"@referredType\": \"WorkOrder\"
        }
      ],
      \"timeZone\": \"US/Arizona\"
    }" \
    --user 'username':'password'

Response:

    {
      "validFor": {
        "startDateTime": "2024-07-19 09:00:00",
        "endDateTime": "2024-07-19 11:00:00"
      },
      "category": "e4c1116b3b810300ce8a4d72f3efc40f",
      "relatedParty": [
        {
          "id": "eaf68911c35420105252716b7d40ddde",
          "name": "Sally Thomas",
          "role": "customer",
          "@referredType": "Individual"
        }
      ],
      "relatedPlace": {
        "id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
        "name": "100 South Charles Street, Baltimore,MD",
        "role": "interventionAddress",
        "@referredType": "GeographicAddress"
      },
      "relatedEntity": [
        {
          "id": "48dbfbf9201f0250f877303e8a020dcd",
          "role": "work order",
          "@referredType": "WorkOrder"
        }
      ],
      "timeZone": "US/Arizona",
      "success": true,
      "id": "feacb7f9201f0250f877303e8a020d38",
      "href": "api/sn_tmf_api/appointment/appointment/feacb7f9201f0250f877303e8a020d38",
      "creationDate": "2024-07-10 22:45:01",
      "lastUpdate": "2024-07-10 22:45:01"
    }


