The Workplace Service Delivery (WSD) Reservation Invitees API provides endpoints to add invitees to reservations, fetch invitees of a reservation, and reassign invitees of a reservation.

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

This API runs in the sn_wsd_rsv namespace.

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

WSD Reservation Invitees - GET /api/sn_wsd_rsv/wsd_reservation_invitees/reservation/{sys_id}

Retrieves details about the invitees associated with a specified reservation.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/wsd_reservation_invitees/reservation/{sys_id}

Default URL: /api/sn_wsd_rsv/reservation/{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 reservation for which to return the invitee details.

Data type: String

Table 2. Query parameters
Name Description
None
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 response body. Supported types: application/json or application/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 retrieve the invitees for a reservation.

curl 
"http://instance.servicenow.com/api/sn_wsd_rsv/wsd_reservation_invitees/reservation/17979dc9536b01103cf7ddeeff7b12b3" \
--request GET \
--header "Accept:application/json" \
--user 'username':'password'

Return results:

{
  "result": {
    "success": true,
    "reservationId": "17979dc9536b01103cf7ddeeff7b12b3",
    "reservationSubType": "single",
    "invitees": [
      {
        "reservationId": "17979dc9536b01103cf7ddeeff7b12b3",
        "location": {
          "sysId": "19efb84edb7650106c731dcd1396193c",
          "displayName": "Dublin"
        },
        "reservationInviteeId": "1f97d58d53e701103cf7ddeeff7b129a",
        "inviteeType": "employee",
        "inviteState": {
          "displayValue": "New",
          "value": "new"
        },
        "inviteeId": "6816f79cc0a8016401c5a33be04be441",
        "name": "System Administrator",
        "email": "admin@example.com"
      },
      {
        "reservationId": "17979dc9536b01103cf7ddeeff7b12b3",
        "location": {
          "sysId": "19efb84edb7650106c731dcd1396193c",
          "displayName": "Dublin"
        },
        "reservationInviteeId": "8ee7ddc9536b01103cf7ddeeff7b1219",
        "inviteeType": "employee",
        "inviteState": {
          "displayValue": "New",
          "value": "new"
        },
        "inviteeId": "62826bf03710200044e0bfc8bcbe5df1",
        "name": "Abel Tuter",
        "email": "abel.tuter@example.com"
      },
      {
        "reservationId": "17979dc9536b01103cf7ddeeff7b12b3",
        "location": {
          "sysId": "19efb84edb7650106c731dcd1396193c",
          "displayName": "Dublin"
        },
        "reservationInviteeId": "4ae7d10d536b01103cf7ddeeff7b126b",
        "inviteeType": "visitor",
        "inviteState": {
          "displayValue": "New",
          "value": "new"
        },
        "inviteeId": "86e7d10d536b01103cf7ddeeff7b1267",
        "firstName": "Visitor",
        "lastName": "User",
        "name": "Visitor User",
        "email": "visitoruser@example.com",
        "phoneNumber": "+919876543210",
        "isVIP": true,
        "parkingType": "normal_parking",
        "licensePlate": "1234",
        "isParkingRequired": true,
        "org": "Senow",
        "visitorType": "contractor",
        "title": "President",
        "isWifiRequired": true,
        "privateNotes": "Visiting"
      }
    ]
  }
}

WSD Reservation Invitees - POST /api/sn_wsd_rsv/wsd_reservation_invitees/reassign

Reassigns the specified invitees from one reservation to another.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/wsd_reservation_invitees/reassign

Default URL: /api/sn_wsd_rsv/wsd_reservation_invitees/reassign

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 8. Query parameters
Name Description
None
Table 9. Request body parameters
Name Description
reservationId Required. Sys_id of the reservation for which to reassign the invitees.

Data type: String

Table: Workplace Reservation [sn_wsd_rsv_reservation]

reservationInvitees List of invitees to reassign to the reservation identified in the reservationId parameter.

This removes the specified invitees from an earlier reservation in which they were present as per the reservation invitee table and moves them to this reservation.

Data type: Array of Strings

Table: Reservation Invitee [sn_wsd_rsv_m2m_reservation_invitee]

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

Name Description
result Details about the invitee reassignment.

Data type: Object

"result": {
   "reservationInviteeIds": [Array],
   "success": Boolean
}
result.reservationInviteeIds List of sys_ids of the reservation invitees that were re-assigned to the specified reservation.

Data type: Array of Strings

result.success Flag that indicates whether the invitees were reassigned to the reservation.
Possible values:
  • true: Invitees were successfully reassigned.
  • false: Invitees weren't reassigned.

Data type: Boolean

Example: cURL request

The following code example shows how to reassign invitees to a reservation.

curl "http://instance.servicenow.com/api/sn_wsd_rsv/wsd_reservation_invitees/reassign" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
\"reservationId\":\"3984e6c1532f01103cf7ddeeff7b129b\",
\"reservationInvitees\":{\"aa31427f531701103cf7ddeeff7b1243\",\"e231427f531701103cf7ddeeff7b1243\"}
}" \
--user 'username':'password'

Return results:

{
  "result": {
    "success": true,
    "reservationInviteeIds": [
      "aa31427f531701103cf7ddeeff7b1243",
      "e231427f531701103cf7ddeeff7b1243"
    ]
  }
}

WSD Reservation Invitees - POST /api/sn_wsd_rsv/wsd_reservation_invitees/submit

Adds the specified invitees to a specified reservation.

URL format

Versioned URL: /api/sn_wsd_rsv/{api_version}/wsd_reservation_invitees/submit

Default URL: /api/sn_wsd_rsv/wsd_reservation_invitees/submit

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

Name Description
result Result of adding the invitees to the reservation.

Data type: Object

"result": {
  "reservationId": "String",
  "success": Boolean
}
result.reservationId Sys_id of the reservation to which the invitee was added.

Data type: String

result.success Flag that indicates whether the invitees were added to the reservation.
Possible values:
  • true: Invitees were successfully added.
  • false: Invitees were not added.

Data type: Boolean

Example: cURL request

The following code example shows how to add both a visitor and an employee to a reservation.

curl "http://instance.servicenow.com/api/sn_wsd_rsv/v1/wsd_reservation_invitees/submit" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{[
  \"reservationId\": \"041c4a13532f01103cf7ddeeff7b12c0\",
  \"invitees\": [
  {
    \"inviteeType\": \"employee\",
    \"inviteeId\": \"62826bf03710200044e0bfc8bcbe5df1\"
  },
  {
    \"inviteeType\":  \"visitor\",
    \"email\": \"visitoruser@example.com\",
    \"firstName\": \"Visitor\",
    \"lastName\":\"User\",
    \"isVIP\":true,
    \"visitorType\":\"contractor\",
    \"title\": \"ServiceNow Developer\",
    \"phone\": \"+91 9876543210\",
    \"isWifiRequired\": true,
    \"parkingType\": \"ev_parking\",
    \"licensePlate\": \"TS00TS0000\",
    \"org\": \"ServiceNow\",
    \"privateNotes\": \"Remarks\"
  }
]}" \
--user 'username':'password'

Return results:

{
  "result": {
    "success": true,
    "reservationId": "17979dc9536b01103cf7ddeeff7b12b3"
  }
}