The Workplace Service Delivery (WSD) Multi Reservation API provides endpoints for managing reservations with multiple workplace locations.

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 Multi Reservation - PATCH /api/sn_wsd_rsv/multi_reservation/cancel/{sys_id}

Cancels a specified multi-reservation.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/multi_reservation/cancel/{sys_id}

Default URL: /api/sn_wsd_rsv/multi_reservation/cancel/{sys_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 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

sys_id Sys_id of the multi-reservation to cancel.

Data type: String

Table: Workplace Reservation [sn_wsd_rsv_reservation]

Table 2. Query parameters
Name Description
None
Table 3. Request body parameters
Name Description
cancel_notes Reason for cancelling the reservation.

Data type: String

Headers

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

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

Content-Type Data format of the request body. Only supports 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 cancel a multi-reservations.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/cancel/1b1fdf5987ab01506342b846dabb35ec" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{\"cancel_notes\":\"Meeting no longer needed.\"}" \ 
--user "username":"password’"

Return results:

{
  "result": {
    "success": true,
    "successfulReservations": [
      {
        "success": true,
        "msg": "Cancelled successfully.",
        "sys_id": "5b1f9f1d87ab01506342b846dabb35a4"
      },
      {
        "success": true,
        "msg": "Cancelled successfully.",
        "sys_id": "931f9f1d87ab01506342b846dabb35a0"
      }
    ],
    "unSuccessfulReservations": [],
    "error": null,
    "parent": "1b1fdf5987ab01506342b846dabb35ec"
  }
}

WSD Multi Reservation - PATCH /api/sn_wsd_rsv/multi_reservation/update/{sys_id}

Updates the reservations associated with a multi-reservation where the same reservation (meeting) has multiple workplace locations.

This endpoint can handle four different update scenarios:
  1. Update the content of the multi-reservation record, such as the subject, date, or time.
  2. Convert the multi-reservation into a single reservation based on the parent (reservation for a single workplace location).
  3. Convert a single reservation (reservation for a single workplace location) into a multi-reservation.
  4. Add or remove a workplace location to an existing multi-reservation.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/multi_reservation/update/{sys_id}

Default URL: /api/sn_wsd_rsv/multi_reservation/update/{sys_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 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

sys_id Sys_id of the reservation to update.
  • Single reservation to multi-reservation: Sys_id of the single reservation.

    Table: Workplace Reservation [sn_wsd_rsv_reservation]

  • Update content of multi-reservation: Sys_id of the parent reservation record.

    Table: Workplace Reservation [sn_wsd_rsv_reservation]

To get the details of a multi parent reservation from the child record, refer to the sys_id in the source_reservation field of the child record.

Data type: String
Table 8. 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 10. Request headers
Header Description
Accept Data format of the request body. Supported types: application/json, application/xml or, text/xml.

Default: application/json

Content-Type Data format of the request body. Only supports 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 modify the content of an existing multi-reservation.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
    \"reservables\":[
        { 
            \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\" 
        }, 
        {
            \"sys_id\":\"02000d4edb7650106c731dcd13961914\"
        }
    ],
    \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
    \"subject\":\"Test 1\",
    \"start\":\"2022-05-27 13:00:00\",
    \"end\":\"2022-05-27 14:00:00\",
    \"requested_for\": \"workplace_user@example.com\"
}" \
--user 'username':'password'

Return results:

{
  "result": {
    "parent": "98ccb4348723cd106342b846dabb359a",
    "success": true,
    "successfulReservations": [
      {
        "success": true,
        "updated": true,
        "cancelled": false,
        "sys_id": "6cccb4348723cd106342b846dabb359d",
        "error": null,
        "reservable": "5eafb44edb7650106c731dcd13961943"
      },
      {
        "success": true,
        "updated": true,
        "cancelled": false,
        "sys_id": "74af283c87ef8d106342b846dabb3592",
        "error": null,
        "reservable": "fe1f744edb7650106c731dcd139619ca"
      }
    ],
    "unSuccessfulReservations": []
  }
}

Example: cURL request

The following code example shows how to add a workplace location to an existing multi-reservation.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
   \"reservables\":[
       { 
           \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\",
           \"is_private\": false 
       }, 
       {
           \"sys_id\":\"5eafb44edb7650106c731dcd13961943\",
           \"is_private\": false
       },
    {
           \"sys_id\":\"c4308d4edb7650106c731dcd1396194c\",
           \"is_private\": false
       }
   ],
   \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
   \"subject\":\"Test 1\",
   \"start\":\"2022-05-27 13:00:00\",
   \"end\":\"2022-05-27 14:00:00\",
   \"requested_for\": \"workplace_user@example.com\"
}" \
--user 'username':'password'

Return results:

{
  "result": {
    "parent": "98ccb4348723cd106342b846dabb359a",
    "success": true,
    "successfulReservations": [
      {
        "success": true,
        "updated": true,
        "cancelled": false,
        "sys_id": "6cccb4348723cd106342b846dabb359d",
        "error": null,
        "reservable": "5eafb44edb7650106c731dcd13961943"
      },
      {
        "success": true,
        "updated": true,
        "cancelled": false,
        "sys_id": "74af283c87ef8d106342b846dabb3592",
        "error": null,
        "reservable": "fe1f744edb7650106c731dcd139619ca"
      },
      {
        "success": true,
        "inserted": true,
        "sys_id": "9e6d78748723cd106342b846dabb35a5",
        "error": null,
        "reservable": "c4308d4edb7650106c731dcd1396194c"
      }
    ],
    "unSuccessfulReservations": []
  }
}

Example: cURL request

The following code example shows how to convert a single reservation to a multi-reservation.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
   \"reservables\":[
       { 
           \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\",
           \"is_private\": false
       }, 
       {
           \"sys_id\":\"5eafb44edb7650106c731dcd13961943\",
           \"is_private\": false
       }
   ],
   \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
   \"subject\":\"Test 1\",
   \"start\":\"2022-05-27 13:00:00\",
   \"end\":\"2022-05-27 14:00:00\",
   \"requested_for\": \"workplace_user@example.com\"
}" \
--user 'username':'password'

Return results:

{
  "result": {
    "success": true,
    "parent": "98ccb4348723cd106342b846dabb359a",
    "successfulReservations": [
      {
        "success": true,
        "inserted": true,
        "sys_id": "6cccb4348723cd106342b846dabb359d",
        "error": null,
        "reservable": "5eafb44edb7650106c731dcd13961943"
      },
      {
        "success": true,
        "insert": false,
        "update": true,
        "cancel": false,
        "sys_id": "74af283c87ef8d106342b846dabb3592",
        "reservable": "fe1f744edb7650106c731dcd139619ca"
      }
    ],
    "unSuccessfulReservations": [],
    "error": null
  }
}

Example: cURL request

The following code example shows how to convert a multi-reservation into a single reservation.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/update/02000d4edb7650106c731dcd13961914" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
   \"reservables\":[
       { 
           \"sys_id\":\"fe1f744edb7650106c731dcd139619ca\",
           \"is_private\": false
       }
   ],
   \"reservable_module\":\"c31241cedb7650106c731dcd13961917\",
   \"subject\":\"Test 1\",
   \"start\":\"2022-05-27 13:00:00\",
   \"end\":\"2022-05-27 14:00:00\",
   \"requested_for\": \"workplace_user@example.com\"
}" \
--user 'username':'password'

Return results:

{
  "result": {
    "sys_id": "74af283c87ef8d106342b846dabb3592",
    "success": true,
    "successfulReservations": [
      {
        "success": true,
        "insert": false,
        "update": true,
        "cancel": false,
        "sys_id": "74af283c87ef8d106342b846dabb3592",
        "reservable": "fe1f744edb7650106c731dcd139619ca",
        "error": ""
      },
      {
        "success": true,
        "insert": false,
        "update": true,
        "cancel": true,
        "sys_id": "3caf283c87ef8d106342b846dabb3596",
        "reservable": "5eafb44edb7650106c731dcd13961943"
      }
    ],
    "unSuccessfulReservations": [],
    "error": null
  }
}

WSD Multi Reservation - POST /api/sn_wsd_rsv/multi_reservation/add

Creates workplace reservations for the same time at different workplace locations.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/multi_reservation/add

Default URL: /api/sn_wsd_rsv/multi_reservation/add

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 14. 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 16. Request headers
Header Description
Accept Data format of the request body. Supported types: application/json, application/xml or, text/xml.

Default: application/json

Content-Type Data format of the request body. Only supports 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

Example: cURL request

This code example shows how to reserve two different workplaces for the same reservation.

curl "https://instance.servicenow.com/api/sn_wsd_rsv/multi_reservation/add" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
    \"reservable_module\": \"c31241cedb7650106c731dcd13961917\",
    \"subject\": \"Test-123\",
    \"reservation_purpose\": \"meeting\",
    \"timezone\": \"US/Pacific\",
    \"requested_for\": \"6816f79cc0a8016401c5a33be04be441\",
    \"reservables\": [
        {
            \"sys_id\": \"fe1f744edb7650106c731dcd139619ca\",
            \"is_private\": false
        },
        {
            \"sys_id\": \"d1208d4edb7650106c731dcd1396194a\",
            \"is_private\": false
        }
    ],
    \"start\": \"2023-01-12T11:30:00Z\",
    \"end\": \"2023-01-12T12:30:00Z\",
    \"reservation_type\": \"space\"
}" \
--user "username":"password"

Return results:

{
  "result": {
    "success": true,
    "parent": "08e8a18687586550cfaa99b73cbb354f",
    "successfulReservations": [
      {
        "success": true,
        "inserted": true,
        "sys_id": "44e8a18687586550cfaa99b73cbb3552",
        "error": null,
        "reservable": "fe1f744edb7650106c731dcd139619ca"
      },
      {
        "success": true,
        "inserted": true,
        "sys_id": "04e8a18687586550cfaa99b73cbb3555",
        "error": null,
        "reservable": "d1208d4edb7650106c731dcd1396194a"
      }
    ],
    "unSuccessfulReservations": []
  }
}