The Workplace Service Delivery (WSD) Search API provides endpoints to search for available locations and workplace items such as reservables, reservable modules, and available shifts.

To access this API, the caller must have the sn_wsd_core.workplace_user role and the Workplace Safety Management (sn_wsd_core) and Workplace Reservation Management (sn_wsd_rsv) plugins must be activated.

This API runs in the sn_wsd_rsv namespace.

For additional information on Workplace Reservation Management, see Workplace Reservation Management.

WSD Search - GET /api/sn_wsd_rsv/search/availability

Checks whether the specified reservables are available for the specified times.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/search/availability

Default URL: /api/sn_wsd_rsv/search/availability

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 1. Path parameters
Name Description
api_version Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.

Data type: String

Table 3. Request body parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 4. Request headers
Header Description
Accept Data format of the request body. Supported types: application/json, application/xml or, text/xml.

Default: application/json

Table 5. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters

Example: cURL request

The following code example shows how to call this endpoint. Note: Line breaks have been added to the query parameters for easier reading.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/search/availability?
reservable_module=5db44502dbb650106c731dcd13961937&
start=2023-10-12T11:00:00Z&
end=2023-10-15T12:00:00Z&
reservable_ids=adb35f1977220110b3d7be377b5a99fc&
reservation_ids=undefined&
shift=undefined&
schedule_view_obj={"schedule_view_date":"2023-10-12","timezone":"Europe/Paris"}&
timezone=Europe/Paris&
include_reservations_within_days=true&
ignore_same_day_validation=true&
include_unavailable_items=true"  \
--request GET \
--header "Accept:application/json" \
--user "username":"password"

Return results:

{
  "result": [
    {
      "sys_id": "fe1f744edb7650106c731dcd139619ca",
      "email": null,
      "name": "Aspen",
      "is_available": true,
      "availableTimes": [
        [
          "2022-04-23 07:00:00",
          "2022-04-23 08:30:00"
        ],
        [
          "2022-04-23 09:30:00",
          "2022-04-23 23:00:00"
        ],
        [
          "2022-04-24 00:00:00",
          "2022-04-24 06:59:59"
        ]
      ],
      "floor": {
        "sys_id": "2f554296dbba10106c731dcd139619ed",
        "display_value": "Floor 2",
        "name": "Floor 2"
      },
      "building": {
        "sys_id": "94e264cedb3650106c731dcd13961919",
        "display_value": "CAL-B1",
        "name": "CAL-B1"
      },
      "campus": {
        "sys_id": "82b2a0cedb3650106c731dcd139619e9",
        "display_value": "California Campus",
        "name": "California Campus"
      },
      "reservations": [
        {
          "sys_id": "5fe65830874bc9106342b846dabb352b",
          "number": "WRES0001001",
          "location": {
            "location": "fe1f744edb7650106c731dcd139619ca",
            "timezone": {
              "value": "US/Pacific",
              "displayValue": "US/Pacific"
            }
          },
          "configuration_item": null,
          "start": "2022-04-23T08:30:00Z",
          "end": "2022-04-23T09:30:00Z",
          "subject": null,
          "reservation_purpose": {
            "value": "meeting",
            "display_value": "Meeting"
          },
          "state": {
            "value": "confirmed",
            "display_value": "Confirmed"
          },
          "is_collided": false,
          "requested_for": {
            "sys_id": "2de07e1887cb89106342b846dabb35fe",
            "name": "Workplace User"
          }
        }
      ]
    }
  ]
}

WSD Search - GET /api/sn_wsd_rsv/search/best_match

Searches for the best reservable item match based on provided search criteria.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/search/best_match

Default URL: /api/sn_wsd_rsv/search/best_match

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 7. Path parameters
Name Description
api_version Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.

Data type: String

Table 9. Request body parameters
Header Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 10. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Table 11. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters

Example: cURL request

The following code example shows how to call this endpoint.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/search/best_match?q=building%3D9e0364cedb3650106c731dcd1396192b&start=2023-01-04T07%3A00%3A00Z&time_slot=d5331cf2dbb5f01038e42b24ca961906&end=2023-01-04T17%3A00%3A00Z&best_match_count=1&reservable_module=2b636b7e1b4e60103523ff751a4bcbe2&timezone=Europe%2FAmsterdam" \
--request GET \
--header "Accept:application/json" \
--user "username":"password"

Return results:

{
  "result": {
    "hasMore": false,
    "reservableUnits": [
      {
        "sys_id": "fe1f744edb7650106c731dcd139619ca",
        "external_id": null,
        "email": null,
        "name": "Aspen",
        "title": "Aspen",
        "description": "A room with large windows, dark leather seats and a large wooden table.",
        "image": {
          "sys_id": "41c74902dbb650106c731dcd13961944",
          "link": "41c74902dbb650106c731dcd13961944.iix"
        },
        "number": "ROOM0000903",
        "site": {
          "sys_id": "628eec06db7650106c731dcd139619dd",
          "display_value": "North America"
        },
        "campus": {
          "sys_id": "82b2a0cedb3650106c731dcd139619e9",
          "display_value": "California Campus"
        },
        "building": {
          "sys_id": "94e264cedb3650106c731dcd13961919",
          "display_value": "CAL-B1"
        },
        "floor": {
          "sys_id": "2f554296dbba10106c731dcd139619ed",
          "display_value": "Floor 2"
        },
        "area": null,
        "capacity": "16",
        "reservable_quantity": null,
        "location_type": {
          "sys_id": "20713b83eb512010b89bfdfc9c522899",
          "display_value": "Room",
          "name": "Room"
        },
        "order": null,
        "requires_check_in": null,
        "is_reservable": "1",
        "tableName": "sn_wsd_core_room",
        "require_approval": false,
        "standard_services": [
          {
            "sys_id": "abd0c18edb7650106c731dcd13961965",
            "name": "Projector screen",
            "short_description": "Connect laptop to screen (HDMI and DVI)",
            "font_awesome_icon": "fa-caret-square-o-right"
          }
        ],
        "reservable_purposes": [
          {
            "sys_id": "18f4c3cd1ba4e01051848489cc4bcb82",
            "name": "Board room",
            "short_description": null
          }
        ],
        "is_available": true,
        "reservations": [
          {
            "sys_id": "5fe65830874bc9106342b846dabb352b",
            "number": "WRES0001001",
            "location": {
              "location": "fe1f744edb7650106c731dcd139619ca",
              "timezone": {
                "value": "US/Pacific",
                "displayValue": "US/Pacific"
              }
            },
            "configuration_item": null,
            "start": "2022-04-23T08:30:00Z",
            "end": "2022-04-23T09:30:00Z",
            "subject": null,
            "reservation_purpose": {
              "value": "meeting",
              "display_value": "Meeting"
            },
            "state": {
              "value": "confirmed",
              "display_value": "Confirmed"
            },
            "is_collided": false,
            "requested_for": {
              "sys_id": "2de07e1887cb89106342b846dabb35fe",
              "name": "Workplace User"
            }
          },
          {
            "sys_id": "af075c30874bc9106342b846dabb3572",
            "number": "WRES0001002",
            "location": {
              "location": "fe1f744edb7650106c731dcd139619ca",
              "timezone": {
                "value": "US/Pacific",
                "displayValue": "US/Pacific"
              }
            },
            "configuration_item": null,
            "start": "2022-04-23T23:00:00Z",
            "end": "2022-04-24T00:00:00Z",
            "subject": null,
            "reservation_purpose": {
              "value": "meeting",
              "display_value": "Meeting"
            },
            "state": {
              "value": "confirmed",
              "display_value": "Confirmed"
            },
            "is_collided": false,
            "requested_for": {
              "sys_id": "2de07e1887cb89106342b846dabb35fe",
              "name": "Workplace User"
            }
          }
        ],
        "availableTimes": [
          [
            "2022-04-23 07:00:00",
            "2022-04-23 08:30:00"
          ],
          [
            "2022-04-23 09:30:00",
            "2022-04-23 23:00:00"
          ],
          [
            "2022-04-24 00:00:00",
            "2022-04-24 06:59:59"
          ]
        ],
        "is_favorite": false
      }
    ],
    "reservableContainers": [],
    "nextItemIndex": -1,
    "floorsOfSelectedBuilding": [
      {
        "sys_id": "2f554296dbba10106c731dcd139619ed",
        "display_value": "Floor 2",
        "external_id": null,
        "name": "Floor 2"
      }
    ]
  }
}{
  "result": {
    "hasMore": false,
    "reservableUnits": [
      {
        "sys_id": "32f2a98adb7210106c731dcd13961972",
        "external_id": null,
        "wsd_email": null,
        "name": "B1-03-04",
        "title": "B1-03-04",
        "description": "Desk reserved for the Team-C. After 10am, free to reserve for everyone.",
        "image": {
          "sys_id": "57b42dcadb7210106c731dcd13961945",
          "link": "57b42dcadb7210106c731dcd13961945.iix"
        },
        "number": "SPCE0009018",
        "site": {
          "sys_id": "b17220cedb3650106c731dcd1396197a",
          "display_value": "Western Europe"
        },
        "campus": {
          "sys_id": "44d2e0cedb3650106c731dcd13961988",
          "display_value": "Amsterdam Campus"
        },
        "building": {
          "sys_id": "9e0364cedb3650106c731dcd1396192b",
          "display_value": "AMS-B1"
        },
        "floor": {
          "sys_id": "5373a8cedb3650106c731dcd1396198a",
          "display_value": "Floor 3"
        },
        "area": {
          "sys_id": "410ff04edb7650106c731dcd13961973",
          "display_value": "Desks C1"
        },
        "capacity": "1",
        "reservable_quantity": null,
        "location_type": {
          "sys_id": "5f017383eb512010b89bfdfc9c5228c8",
          "display_value": "Workspace/Desk",
          "name": "Workspace/Desk"
        },
        "order": null,
        "requires_check_in": null,
        "is_reservable": "1",
        "tableName": "sn_wsd_core_space",
        "require_approval": false,
        "is_available": true,
        "reservations": [],
        "availableTimes": [
          [
            "2023-01-04 07:00:00",
            "2023-01-04 17:00:00"
          ]
        ],
        "showPrivacyOption": false,
        "defaultPrivacyValue": false,
        "container": {
          "sys_id": "410ff04edb7650106c731dcd13961973",
          "display_value": "Desks C1",
          "floor": {
            "sys_id": "5373a8cedb3650106c731dcd1396198a",
            "display_value": "Floor 3",
            "name": "Floor 3"
          },
          "building": {
            "sys_id": "9e0364cedb3650106c731dcd1396192b",
            "display_value": "AMS-B1",
            "name": "AMS-B1"
          },
          "campus": {
            "sys_id": "44d2e0cedb3650106c731dcd13961988",
            "display_value": "Amsterdam Campus",
            "name": "Amsterdam Campus"
          },
          "capacity": 6,
          "image": {
            "sys_id": "d52c27b21b8e60103523ff751a4bcb49",
            "link": "d52c27b21b8e60103523ff751a4bcb49.iix"
          }
        },
        "includedInResult": true,
        "is_favorite": true
      }
    ],
    "reservableContainers": [
      {
        "sys_id": "410ff04edb7650106c731dcd13961973",
        "display_value": "Desks C1",
        "floor": {
          "sys_id": "5373a8cedb3650106c731dcd1396198a",
          "display_value": "Floor 3",
          "name": "Floor 3"
        },
        "building": {
          "sys_id": "9e0364cedb3650106c731dcd1396192b",
          "display_value": "AMS-B1",
          "name": "AMS-B1"
        },
        "campus": {
          "sys_id": "44d2e0cedb3650106c731dcd13961988",
          "display_value": "Amsterdam Campus",
          "name": "Amsterdam Campus"
        },
        "capacity": 6,
        "image": {
          "sys_id": "d52c27b21b8e60103523ff751a4bcb49",
          "link": "d52c27b21b8e60103523ff751a4bcb49.iix"
        }
      }
    ],
    "nextItemIndex": -1,
    "floorsOfSelectedBuilding": [
      {
        "sys_id": "5373a8cedb3650106c731dcd1396198a",
        "display_value": "Floor 3",
        "external_id": null,
        "name": "Floor 3"
      }
    ]
  }

WSD Search - GET /api/sn_wsd_rsv/search/overlapping_reservation

Determines whether an overlapping reservation exists based on the passed parameters.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/search/overlapping_reservation

Default URL: /api/sn_wsd_rsv/search/overlapping_reservation

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 13. Path parameters
Name Description
api_version Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.

Data type: String

Table 15. Request body parameters (XML or JSON)
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 16. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

Table 17. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters (JSON or XML)

Name Description
results Details of the results of the overlap check.

Data type: Object

"results": {
  "isOverlapped": Boolean,
  "reservableId": "String"
}
results.isOverlapped Flag that indicates whether an overlapping reservation exists.

Valid values:

  • true: Overlapping reservation exists.
  • false: Overlapping reservation doesn’t exist.

Data type: Boolean

results.reservableId In the case of a group reservation, the sys_id of the reservable for which the overlap occurs.

Data type: String

Example: cURL request

The following code example shows how to check for a reservation overlap for a specific user and for a specific period of time denoted by the start and end parameters.

curl "http://instance.servicenow.com/api/sn_wsd_rsv/search/overlapping_reservation?user_id=2e617fecc3d365101e38b23bb00131ec&end=2023-06-19T8:00:00Z&start=2023-06-19T07:00:00Z" \
--request GET \
--header "Accept:application/json" \
--user 'username':'password'

Return results:

{
"results": {
  "isOverlapped": True,
  "reservableId": ""
  }
}

WSD Search - GET /api/sn_wsd_rsv/search/reservable

Searches for available reservable items using a specified reservable model configuration.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/search/reservable

Default URL: /api/sn_wsd_rsv/search/reservable

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 19. Path parameters
Name Description
api_version Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.

Data type: String

Table 21. Request body parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 22. Request headers
Header Description
Accept Data format of the request body. Supported types: application/json, application/xml or, text/xml.

Default: application/json

Table 23. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters

Example: cURL request

This example shows how to search for reservables using this endpoint. Note: Line breaks have been added to the query parameters for easier reading.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/search/reservable?
reservable_module=d9864189c3653910977396cb05013100&
start=2023-10-12T10:30:00Z&
end=2023-10-13T11:30:00Z&
include_standard_services=true&
include_reservable_purposes=true&
include_reservations_within_days=true&
include_unavailable_items=true&
near_by_location_id=undefined&
timezone=Europe/Paris&
page_size=6&
sort_by=a_z&
view=schedule&
rsv_path=browse_all&
ignore_same_day_validation=true&
schedule_view_obj={"schedule_view_date":"2023-10-12","timezone":"Europe/Paris"}&
q=building=dea39b1977220110b3d7be377b5a9955\
--request GET \
--header "Accept:application/json" 
--user "username":"password"

Return results:

{
  "result": {
    "hasMore": true,
    "reservableUnits": [
      {
        "sys_id": "fe1f744edb7650106c731dcd139619ca",
        "external_id": null,
        "email": null,
        "name": "Aspen",
        "title": "Aspen",
        "description": "A room with large windows, dark leather seats and a large wooden table.",
        "image": {
          "sys_id": "41c74902dbb650106c731dcd13961944",
          "link": "41c74902dbb650106c731dcd13961944.iix"
        },
        "number": "ROOM0000903",
        "site": {
          "sys_id": "628eec06db7650106c731dcd139619dd",
          "display_value": "North America"
        },
        "campus": {
          "sys_id": "82b2a0cedb3650106c731dcd139619e9",
          "display_value": "California Campus"
        },
        "building": {
          "sys_id": "94e264cedb3650106c731dcd13961919",
          "display_value": "CAL-B1"
        },
        "floor": {
          "sys_id": "2f554296dbba10106c731dcd139619ed",
          "display_value": "Floor 2"
        },
        "area": null,
        "capacity": "16",
        "reservable_quantity": null,
        "location_type": {
          "sys_id": "20713b83eb512010b89bfdfc9c522899",
          "display_value": "Room",
          "name": "Room"
        },
        "order": null,
        "requires_check_in": null,
        "is_reservable": "1",
        "tableName": "sn_wsd_core_room",
        "require_approval": false,
        "standard_services": [
          {
            "sys_id": "9b01458edb7650106c731dcd13961945",
            "name": "Flip chart",
            "short_description": "Flip chart with paper sheets",
            "font_awesome_icon": "fa-calendar-o"
          }
        ],
        "reservable_purposes": [
          {
            "sys_id": "18f4c3cd1ba4e01051848489cc4bcb82",
            "name": "Board room",
            "short_description": null
          }
        ],
        "is_available": true,
        "reservations": [
          {
            "sys_id": "5fe65830874bc9106342b846dabb352b",
            "number": "WRES0001001",
            "location": {
              "location": "fe1f744edb7650106c731dcd139619ca",
              "timezone": {
                "value": "US/Pacific",
                "displayValue": "US/Pacific"
              }
            },
            "configuration_item": null,
            "start": "2022-04-23T08:30:00Z",
            "end": "2022-04-23T09:30:00Z",
            "subject": null,
            "reservation_purpose": {
              "value": "meeting",
              "display_value": "Meeting"
            },
            "state": {
              "value": "confirmed",
              "display_value": "Confirmed"
            },
            "is_collided": false,
            "requested_for": {
              "sys_id": "2de07e1887cb89106342b846dabb35fe",
              "name": "Workplace User"
            }
          }
        ],
        "availableTimes": [
          [
            "2022-04-23 07:00:00",
            "2022-04-23 08:30:00"
          ],
          [
            "2022-04-23 09:30:00",
            "2022-04-23 23:00:00"
          ]
        ],
       "is_reserved": true,
       "is_selected": true,
        "includedInResult": true,
        "is_favorite": false
      }
    ],
    "reservableContainers": [],
    "nextItemIndex": -1,
    "filter": {
      "floors": [],
      "standard_services": [
        {
          "sys_id": "9b01458edb7650106c731dcd13961945",
          "name": "Flip chart",
          "short_description": "Flip chart with paper sheets",
          "font_awesome_icon": "fa-calendar-o"
        }
      ],
      "reservable_purposes": [
        {
          "sys_id": "18f4c3cd1ba4e01051848489cc4bcb82",
          "name": "Board room",
          "short_description": null
        }
      ]
    },
    "totalProcessed": 2,
    "nextFavIndex": 0
  }
}

WSD Search - GET /api/sn_wsd_rsv/search/shift/{building_id}/{module_id}

Returns an encoded query that you can use to search for available shifts in the Shift [sn_wsd_core_shift] table.

Only applicable if the appy_to_shift field in the specified reservable module is enabled. Otherwise, the returned encoded query string will be empty.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/search/shift/{building_id}/{module_id}

Default URL: /api/sn_wsd_rsv/search/shift/{building_id}/{module_id}

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 25. Path parameters
Name Description
api_version Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.

Data type: String

building_id Sys_id of the building to include in the search query.

Data type: String

Table: Building [sn_wsd_core_building]

module_id Sys_id of the reservable module to include in the search query. A reservable module groups similar types of workplace items, such a chairs or desks.

Data type: String

Table: Reservable Module [sn_wsd_core_reservable_module]

Table 26. Query parameters
Name Description
None
Table 27. Request body parameters
Name Description
end_date Shift end date and time to include in the encoded query.

Data type: String

Format: yyyy-mm-dd hh:mm:ss

start_date Shift start date and time to include in the encoded query.

Data type: String

Format: yyyy-mm-dd hh:mm:ss

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.

Table 28. Request headers
Header Description
Accept Data format of the request body. Supported types: application/json, application/xml or, text/xml.

Default: application/json

Table 29. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters

Name Description
result Encoded query to use to acquire the specified available shifts.

Data type: Object

"result": { 
  "moduleHasShift": Boolean,
  "query": "String"
}
moduleHasShift Flag that indicates whether the specified reservable module has shifts enabled.
Valid values:
  • true: Reservable module has shifts enabled.
  • false: Reservable module doesn't has shifts enabled. No encoded query returned.

Data type: Boolean

query Encoded query to use to retrieve shift information for the specified reservable module.

Data type: String

Example: cURL request

The following code example shows how to use this endpoint to obtain a shift encoded query.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/search/shift/94e264cedb3650106c731dcd13961919/fc71f64fdb42a01097acc900399619a8?start_date=2022-04-23 16:00:00&end_date=2022-04-28 16:00:00"  \
--request GET \
--header "Accept:application/json" \
--user "username":"password"

Return results:

{
  "result": { 
    "moduleHasShift" : true,
    "query" : "active=true^state=2^building=94e264cedb3650106c731dcd13961919^building.is_reservable=true^building.active=true^floorISEMPTY^ORfloor.is_reservable=true^floorISEMPTY^ORfloor.active=true^start<=2022-04-26 16:00:00^ORstartISEMPTY^end>=2022-04-28 16:00:00^ORendISEMPTY^start<=2022-04-28 16:00:00^ORstartISEMPTY^end>=2022-04-28 16:00:00^ORendISEMPTY"
  }
}

WSD Search - POST /api/sn_wsd_rsv/search/availability_score

Returns an availability score for reservable items for specified timeslots.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/search/availability_score

Default URL: /api/sn_wsd_rsv/search/availability_score

Note: Available versions are specified in the REST API Explorer. For scripted REST APIs there is additional version information on the Scripted REST Service form.

Supported request parameters

Table 31. Path parameters
Name Description
api_version Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the latest.

Data type: String

Table 32. Query parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 34. Request headers
Header Description
Accept Data format of the response body. Supported types: application/json or application/xml.

Default: application/json

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

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters

Example: cURL request

The following code example shows how to call this endpoint.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/search/availability_score" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
  \"reservableType\": \"location\",
  \"reservableIds\": [
    \"fe1f744edb7650106c731dcd139619ca\",
    \"5eafb44edb7650106c731dcd13961943\"
  ],
  \"recurringPattern\": {
    \"duration\": 3600000,
    \"repeats\": \"daily\",
    \"options\": {
      \"count\": 150,
      \"daysOfWeek\": \"\",
      \"every\": 1
    },
    \"label\": \"Repeats daily, 5 times\",
    \"startDate\": \"2022-04-26T14:00:00Z\"
  },
  \"startEndDateTimes\": [
    {
      \"start\": \"2022-07-05 14:00:00\",
      \"end\": \"2022-07-05 15:00:00\"
    },
    {
      \"start\": \"2022-07-06 14:00:00\",
      \"end\": \"2022-07-06 15:00:00\"
    }
  ]
}" \
--user "username":"password"

Return results:

{
  "result": {
    "fe1f744edb7650106c731dcd139619ca": {
      "available": 2,
      "total": 2,
      "score": "2/2"
    },
    "5eafb44edb7650106c731dcd13961943": {
      "available": 2,
      "total": 2,
      "score": "2/2"
    }
  }