Shift Plan Web Service

Shift Plan Web Service

Describes all endpoints to request shift plan web service between an HR system and the Staffbase HR platform. This includes:

/shifts/{shiftId}

GET

Request a specific shift plan that is identified by its id with all available data. To know more about the schema used, refer Complete Shift Details.

Responses

200 OK

Returns the specific shift plan that was requested.


Examples:

Content-Type: application/json
{
  "id": "1",
  "userId": "100",
  "workplaceId": "1",
  "start": "2019-09-30T08:51:33.112Z",
  "end": "2019-09-30T14:51:33.112Z",
  "breakTime": "00:30",
  "position": "Sales"

}

					

/users/{userId}/shifts

GET

Request a list of shift plans of a user that is identified by its id with minimum data. To know more about the schema used, refer Complete Shift Lists.

Responses

200 OK

Returns a list of shift plans of a user that was requested.


Examples:

Content-Type: application/json
[
  {
    "id": "1",
    "workplaceName": "Store 001",
    "start": "2019-09-28T08:51:33.112Z",
    "end": "2019-09-28T14:51:33.112Z"
  },
  {
    "id": "2",
    "workplaceName": "Store 001",
    "start": "2019-09-30T08:51:33.112Z",
    "end": "2019-09-30T14:51:33.112Z"
  }
]


					

/workplaces/{workplaceId}

GET

Requests the details of a specific workplace. To know more about the schema used, refer Workplace Details.

Responses

200 OK

Returns the details of a specific workplace.


Examples:

Content-Type: application/json
{
  "id": "1",
  "address": "Main Street 10, 44493 Sampletown",
  "contactIds": [
    "1",
    "2"
  ],
  "name": "Store 001"

}



					

/contacts/{contactId}

GET

Requests the contact details of a person in charge of a workplace. To know more about the schema used, refer Contact Person Details.

Responses

200 OK

Returns the details of the specific contact person that was requested.


Examples:

Content-Type: application/json
{
  "id": "1",
  "name": "John Doe",
  "position": "Store Manager"

}




					

Shift Plan Web Service Schemas

The following schemas describe data structures used in the Shift Plan web service.

Complete Shift Details

When requesting a specific shift plan these are the details in response.

Name Type Description Accepted Values
id (required) string The identifier of the shift plan. any
userId (required) string The identifier of the user to whom this shift belongs to. any
start (required) string The beginning of the shift as an ISO date and time format string. any
end (required) string The end of the shift as an ISO date and time format string. any
breakTime (required) string The total time allotted for breaks during the shift. any
position (required) string The job title held by the user to whom this shift belongs. any
workplaceId (required) string The id of the workplace to request more information via the workplace endpoint. any

Example:


  "id": "1",
  "userId": "100",
  "workplaceId": "1",
  "start": "2019-09-30T08:51:33.112Z",
  "end": "2019-09-30T14:51:33.112Z",
  "breakTime": "00:30",
  "position": "Sales"
}

					

Complete Shift Lists

When requesting a shift plan of a user these are the details in response.

Name Type Description Accepted Values
ShiftList (require) array(object) The complete list of shifts. any
ShiftList.id (required) string The identifier of the shift plan. any
ShiftList.workplaceName (required) string The name of the workplace. any
ShiftList.start (required) string The beginning of the shift. any
ShiftList.end (required) string The end of the shift. any
       

Example:


[
  {
    "id": "1",
    "workplaceName": "Store 001",
    "start": "2019-09-28T08:51:33.112Z",
    "end": "2019-09-28T14:51:33.112Z"
  },
  {
    "id": "2",
    "workplaceName": "Store 001",
    "start": "2019-09-30T08:51:33.112Z",
    "end": "2019-09-30T14:51:33.112Z"
  }
]


					

Workplace Details

When requesting the details of a specific workplace these are the details in response.

Name Type Description Accepted Values
id (required) string The identifier of the workplace. any
address (required) string The address of the workplace. any
contactIds (required) array(string) A list of persons in charge of the workplace that can be requested via the contact endpoints. any
name (required) string The name of the workplace. any
ShiftList.end (required) string The end of the shift. any

Example:


{
  "id": "1",
  "address": "Main Street 10, 44493 Sampletown",
  "contactIds": [
    "1",
    "2"
  ],
  "name": "Store 001"
}


					

Contact Person Details

When requesting the details of a specific contact person of a workplace these are the details in response.

Name Type Description Accepted Values
position (required) string The job title of the contact person. any
name (required) string The name of the contact person. any
id (required) string The identifier of the contact person. any

Example:


{
  "id": "1",
  "name": "John Doe",
  "position": "Store Manager"
}