Optional filter query parameters

Parameter

Type

Description

location_id

Integer

Return roles filtered by a location ID.

department_id

Integer

Return roles filtered by a department ID.

limit

Integer

The limit of results that will be returned.

offset

Integer

Return results starting from an offset.

order_field

String

The field you would like the results to be ordered by. Format is {lowercased-singular-method}.{field}. Example: /roles/?order_field=role.modified

order_dir

String

The direction you want the results ordered by. Accepted values are "asc" or "desc". Example: /roles/?order_dir=desc

Example request

https://api.7shifts.com/v1/roles?location_id=123

Example response

{
  "status": "success",
  "total": 2,
  "offset": 0,
  "limit": 250,
  "data": [
    {
      "role": {
        "id": 123,
        "location_id": 1234,
        "department_id": 12345,
        "color": "54acc5",
        "stations": 0,
        "name": "Associate",
        "job_code": "",
        "created": "2017-11-03 02:08:53",
        "modified": "2019-11-21 21:35:07",
        "sort": 0
      },
      "station": []
    },
    {
      "role": {
        "id": 234,
        "location_id": 2345,
        "department_id": 23456,
        "color": "4caf50",
        "stations": 2,
        "name": "Barista",
        "job_code": "",
        "created": "2017-10-06 01:38:31",
        "modified": "2019-11-21 21:35:07",
        "sort": 0
      },
      "station": [
        {
          "id": 642,
          "role_id": 234,
          "station_number": 1,
          "name": "Station 1"
        },
        {
          "id": 643,
          "role_id": 234,
          "station_number": 2,
          "name": "Station 2"
        }
      ]
    }
  ]
}
Language
Authentication
Basic
base64
:
Response
Click Try It! to start a request and see the response here!