---
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


---

# WSD Shift API

# WSD Shift API {#ariaid-title1}

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

The Workplace Service Delivery (WSD) Shift API
provides an endpoint that returns shift time spans for a specified date and time.
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](https://www.servicenow.com/docs/access?context=workplace-rsv-mgmt-feat&version=xanadu&pubname=xanadu-employee-service-management&ft:locale=en-US).

## WSD Shift - GET /api/sn_wsd_rsv/wsd_shift/{shift_id}/timespan {#ariaid-title2}

Returns the shift time span for a specified date/time and shift.
<br />

### URL format

Versioned URL:
/api/sn_wsd_rsv/{api_version}/wsd_shift/{shift_id}/timespan

Default URL:
/api/sn_wsd_rsv/wsd_shift/{shift_id}/timespan

### Supported request parameters

{#wsd_shift-GET-timespan__entry__2}{#wsd_shift-GET-timespan__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| shift_id | Sys_id of the shift to retrieve the time span for. For additional information on shift-based reservations, see [Enable shift-based reservation](https://www.servicenow.com/docs/access?context=wsd-reservation-setup&version=xanadu&pubname=xanadu-employee-service-management&ft:locale=en-US). Data type: String Table: Shift \[sn_wsd_core_shift\] |
[Table 1. Path parameters]

{#wsd_shift-GET-timespan__entry__8}

| Name | Description |
|-|-|
| attempt_earlier_start | Flag that indicates whether to set an early start time if the specified start value is within the shift's time span. Valid values: * true: If the specified shift includes the date/time specified in the start parameter, return the specified start date/time as the start of the time span. * false: Return the shift timespan as defined in the associated record. Data type: Boolean Default: false |
| start | Required. Date and time of the start of the shift time spans to return. Data type: String Format: UTC - yyyy-mm-ddThh:mm:ssZ, such as 2022-05-23T08:00:00Z |
| timezone | Time zone to use when qualifying the shift time spans, such as ECT or PST. Also returns the shift time spans in this time zone. Data type: String Format: UTC Default: User's timezone |
[Table 2. Query parameters]

{#wsd_shift-GET-timespan__entry__16}

| Name | Description |
|-|-|
| None |   |
[Table 3. 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.").
{#wsd_shift-GET-timespan__entry__20}{#wsd_shift-GET-timespan__accept-reserv-entry}

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

{#wsd_shift-GET-timespan__entry__24}

| Header | Description |
|-|-|
| None |   |
[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.").
{#wsd_shift-GET-timespan__entry__28}{#wsd_shift-GET-timespan__entry-200-status-code}{#wsd_shift-GET-timespan__entry-401-status-code}{#wsd_shift-GET-timespan__entry-404-status-code}{#wsd_shift-GET-timespan__entry-500-status-code}

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

### Response body parameters

{#wsd_shift-GET-timespan__entry__38}

| Name | Description |
|-|-|
| result | Details about the shift timespan that matched the search criteria. Data type: Object "result":{ "end": "String", "start": "String" } |
| result.end | End date and time of the shift timespan in the specified time zone. Data type: String Format: UTC: yyyy-mm-ddThh:mm:ssZ, such as 2022-05-23T08:00:00Z |
| result.start | Start date and time of the shift timespan in the specified time zone. Data type: String Format: UTC: yyyy-mm-ddThh:mm:ssZ, such as 2022-05-23T08:00:00Z |
[ ]

### cURL request

The following code example shows how to retrieve the timespan of a shift.

    curl "https://instance.servicenow.com/api/sn_wsd_rsv/wsd_shift/e5d23acfdb42a01097acc9003996193a/timespan?attempt_earlier_start=true&start=2022-05-23T08:00:00Z&timezone=ECT" \
    --request GET \
    --header "Accept:application/json" \
    --user "username":"password"

Return results:

    {
      "result": {
        "start": "2022-05-23T08:00:00Z",
        "end": "2022-05-23T15:00:00Z"
      }
    }


