WSD Multi Reservation API
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}
Supported request parameters
| Name | Description |
|---|---|
| api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
| sys_id | Sys_id of the multi-reservation to cancel. Data type: String Table: Workplace Reservation [sn_wsd_rsv_reservation] |
| Name | Description |
|---|---|
| None |
| 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.
| 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. |
| Header | Description |
|---|---|
| None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
| Status code | Description |
|---|---|
| 200 | Successful. The request was successfully processed. |
| 401 | Unauthorized. The user credentials are incorrect or have not been passed. |
| 404 | Not found. The requested item wasn't found. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
| Name | Description |
|---|---|
| result | Details of the results of the cancel request. Data type: Object |
| result.error | Message that describes the associated error. Data type: String |
| result.parent | Sys_id of the parent reservation. A parent may have one
or more child reservations associated to it. Data type: String |
| result.success | Flag that indicates whether the reservation was successfully cancelled. Possible values:
Data type: Boolean |
| result.successfulReservations | Details about the successful cancellation of the multi-reservation. Data type: Array of Objects |
| result.successfulReservations.msg | Cancellation message. Data type: String |
| result.successfulReservations.success | Flag that indicates whether the reservation was successfully cancelled. Possible values:
Data type: Boolean |
| result.successfulReservations.sys_id | Sys_id of the reservation that was cancelled. Data type: String Table: Workplace Reservation [sn_wsd_rsv_reservation] |
| result.unSuccessfulReservations | Details about the unsuccessful cancellation of the multi-reservation. Data type: Array of Objects |
| result.unSuccessfulReservations.msg | Cancellation message. Data type: String |
| result.unSuccessfulReservations.success | Flag that indicates whether the reservation was successfully cancelled. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations.sys_id | Sys_id of the reservation that was not cancelled. Data type: String Table: Workplace Reservation [sn_wsd_rsv_reservation] |
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.
- Update the content of the multi-reservation record, such as the subject, date, or time.
- Convert the multi-reservation into a single reservation based on the parent (reservation for a single workplace location).
- Convert a single reservation (reservation for a single workplace location) into a multi-reservation.
- 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}
Supported request parameters
| Name | Description |
|---|---|
| api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
| sys_id | Sys_id of the reservation to update.
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 |
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| end | Required if the shift parameter isn't passed in. Requested end time of the reservation. Data type: String Format: UTC or local time (yyyy-mm-dd hh:mm:ss) |
| requested_for | Sys_id or email address of the user for which the reservation is being made. Data type: String Table: User [sys_user] |
| reservables | List of details about the reservables associated with the reservation. Data type: Array of Objects |
| reservables.is_private | Flag that indicates whether the reservation is private. If private, the reservation doesn't appear to anyone except the owner. For additional information on these privacy settings, see Location privacy settings and impact. Valid values:
Data type: Boolean Default: Value set for privacy in the system properties. |
| reservables.sys_id | Sys_id of the location at which to make the reservations. Data type: String Table: Workplace Location [sn_wsd_core_workplace_location] |
| reservable_module | Required. Sys_id of the reservable module to associate with the reservation. A reservable module defines the workplace items needed for a reservation. Data type: String Table: Reservable Module [sn_wsd_rsv_reservable_module] |
| shift | Sys_id of the shift to associate with the reservation. If this parameter is passed in, the end parameter isn't required. For additional information on shift-based reservations, see Enable shift-based reservation. Data type: String Table: Shift [sn_wsd_core_shift] |
| start | Required. Requested start time of the reservation. Data type: String Format: UTC or local time (yyyy-mm-dd hh:mm:ss) |
| subject | Subject of the meeting associated
with 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.
| 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. |
| Header | Description |
|---|---|
| None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
| Status code | Description |
|---|---|
| 200 | Successful. The request was successfully processed. |
| 401 | Unauthorized. The user credentials are incorrect or have not been passed. |
| 404 | Not found. The requested item wasn't found. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
| Name | Description |
|---|---|
| result | Return results from the multi-reservation creation or update. Data type: Object |
| result.parent | Sys_id of the parent reservation. A parent may have one
or more child reservations associated to it. Data type: String |
| result.success | Flag that indicates whether the reservation was successfully created. Possible values:
Data type: Boolean |
| result.successfulReservations | List of the reservations that were successfully created. Data type: Array of Objects |
| result.successfulReservations.cancelled | Flag that indicates whether the reservation was successfully cancelled. Possible values:
Data type: Boolean |
| result.successfulReservations.error | Error message if there was a
problem while creating the reservation. Data type: String |
| result.SuccessfulReservations.insert | Flag that indicates whether the reservation was successfully inserted. Such as when a reservation is added. Possible values:
Data type: Boolean |
| result.successfulReservations.reservable | Sys_id of the workplace for which the reservation was made. Data type: String Table: Workplace Location [sn_wsd_core_workplace_location] |
| result.successfulReservations.success | Flag that indicates whether the associated operation was successful. Possible values:
Data type: Boolean |
| result.successfulReservations.sys_id | Sys_id of the reservation that was created. Data type: String Table: Workplace Reservation [sn_wsd_rsv_reservation] |
| result.successfulReservations.update | Flag that indicates whether the reservation was successfully updated. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations | List of the reservations that were unsuccessful. Data type: Array of Objects |
| result.unSuccessfulReservations.cancelled | Flag that indicates whether the reservation was successfully cancelled. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations.error | Error message if there was a problem while creating the reservation. Data type: String |
| result.unSuccessfulReservations.insert | Flag that indicates whether the reservation was successfully inserted. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations.reservable | Sys_id of the workplace for which the reservation was trying to be made. Data type: String Table: Workplace Location [sn_wsd_core_workplace_location] |
| result.unSuccessfulReservations.success | Flag that indicates whether the reservation was successfully created. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations.sys_id | Sys_id of the unsuccessful reservation. Always null. Data type: String |
| result.unSuccessfulReservations.update | Flag that indicates whether the reservation was successfully updated. Possible values:
Data type: Boolean |
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": []
}
}
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": []
}
}
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
}
}
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
Supported request parameters
| Name | Description |
|---|---|
| api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| end | Required if the shift parameter isn't passed in. Requested end time of the reservation. Data type: String Format: UTC or local time (yyyy-mm-dd hh:mm:ss) |
| requested_for | Sys_id or email address of the user for which the reservation is being made. Data type: String Table: User [sys_user] |
| reservables | List of details about the reservables associated with the reservation. Data type: Array of Objects |
| reservables.is_private | Flag that indicates whether the reservation is private. If private, the reservation doesn't appear to anyone except the owner. For additional information on these privacy settings, see Location privacy settings and impact. Valid values:
Data type: Boolean Default: Value set for privacy in the system properties. |
| reservables.sys_id | Sys_id of the location at which to make the reservations. Data type: String Table: Workplace Location [sn_wsd_core_workplace_location] |
| reservable_module | Required. Sys_id of the reservable module to associate with the reservation. A reservable module defines the workplace items needed for a reservation. Data type: String Table: Reservable Module [sn_wsd_rsv_reservable_module] |
| shift | Sys_id of the shift to associate with the reservation. If this parameter is passed in, the end parameter isn't required. For additional information on shift-based reservations, see Enable shift-based reservation. Data type: String Table: Shift [sn_wsd_core_shift] |
| start | Required. Requested start time of the reservation. Data type: String Format: UTC or local time (yyyy-mm-dd hh:mm:ss) |
| subject | Required. Subject of the meeting associated
with 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.
| 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. |
| Header | Description |
|---|---|
| None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
| Status code | Description |
|---|---|
| 200 | Successful. The request was successfully processed. |
| 401 | Unauthorized. The user credentials are incorrect or have not been passed. |
| 404 | Not found. The requested item wasn't found. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
| Name | Description |
|---|---|
| result | Return results from the multi-reservation creation or update. Data type: Object |
| result.parent | Sys_id of the parent reservation. A parent may have one
or more child reservations associated to it. Data type: String |
| result.success | Flag that indicates whether the reservation was successfully created. Possible values:
Data type: Boolean |
| result.successfulReservations | List of the reservations that were successfully created. Data type: Array of Objects |
| result.successfulReservations.error | Error message if there was a
problem while creating the reservation. Data type: String |
| result.successfulReservations.inserted | Flag that indicates whether the reservation was successfully inserted. Such as when a reservation is added. Possible values:
Data type: Boolean |
| result.successfulReservations.reservable | Sys_id of the workplace for which the reservation was made. Data type: String Table: Workplace Location [sn_wsd_core_workplace_location] |
| result.successfulReservations.success | Flag that indicates whether the reservation was successfully created. Possible values:
Data type: Boolean |
| result.successfulReservations.sys_id | Sys_id of the reservation that was created. Data type: String Table: Workplace Reservation [sn_wsd_rsv_reservation] |
| result.unSuccessfulReservations | List of the reservations that were unsuccessfully. Data type: Array of Objects |
| result.unSuccessfulReservations.error | Error message if there was a problem while creating the reservation. Data type: String |
| result.unSuccessfulReservations.inserted | Flag that indicates whether the reservation was successfully inserted. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations.reservable | Sys_id of the workplace for which the reservation was trying to be made. Data type: String Table: Workplace Location [sn_wsd_core_workplace_location] |
| result.unSuccessfulReservations.success | Flag that indicates whether the reservation was successfully created. Possible values:
Data type: Boolean |
| result.unSuccessfulReservations.sys_id | Sys_id of the unsuccessful reservation. Always null. Data type: String |
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": []
}
}