Skip to main content

Shifts

OpenAPI Specification

Public API (0.0.0)

2GIS GeoFlow Public API

shifts

Getting a list of shifts

Returns a page with a list of shifts for the specified period.

Authorizations:
BearerAuth
query Parameters
limit
required
integer

Maximum number of shifts in the response, from 1 to 100.

cursor
string

Cursor for getting the next or previous page of results.

from
required
string

Date and time of period start in RFC 3339 format.

to
required
string

Date and time of period end in RFC 3339 format.

Responses

Response Schema: application/json
required
object (CursorResponse)

Cursors for the next and previous result pages.

required
Array of objects (ShiftResponse)

Current page items.

Response samples

Content type
application/json
{
  • "cursor": {
    • "next": "string",
    • "prev": "string"
    },
  • "items": [
    • {
      }
    ]
}

Creating a shift

Creates a shift.

Authorizations:
BearerAuth
Request Body schema: application/json
required

Data for creating a shift.

end_at
string <date-time>

Date and time of shift end in RFC 3339 format.

full_day
boolean

Flag indicating that the shift lasts 24 hours.

name
required
string

Shift name.

start_at
string <date-time>

Date and time of shift start in RFC 3339 format.

timezone
required
string

Time zone in IANA format (for example, Europe/Moscow).

Responses

Response Schema: application/json
created_at
required
string <date-time>

Date and time of shift creation in RFC 3339 format.

end_at
string <date-time>

Date and time of shift end in RFC 3339 format.

full_day
required
boolean

Flag indicating that the shift lasts 24 hours.

id
required
string <uuid>

Shift identifier.

name
required
string

Shift name.

start_at
string <date-time>

Date and time of shift start in RFC 3339 format.

timezone
required
string

Time zone in IANA format (for example, Europe/Moscow).

updated_at
required
string <date-time>

Date and time of the shift last update in RFC 3339 format.

Request samples

Content type
application/json
{
  • "end_at": "2019-08-24T14:15:22Z",
  • "full_day": true,
  • "name": "string",
  • "start_at": "2019-08-24T14:15:22Z",
  • "timezone": "string"
}

Response samples

Content type
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "end_at": "2019-08-24T14:15:22Z",
  • "full_day": true,
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "start_at": "2019-08-24T14:15:22Z",
  • "timezone": "string",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Deleting a shift

Deletes a shift by its identifier.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Shift identifier.

Responses

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "message": "string",
  • "metadata": {
    • "property1": "string",
    • "property2": "string"
    },
  • "violations": [
    • {
      }
    ]
}

Getting a shift

Returns shift data by its identifier.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Shift identifier.

Responses

Response Schema: application/json
created_at
required
string <date-time>

Date and time of shift creation in RFC 3339 format.

end_at
string <date-time>

Date and time of shift end in RFC 3339 format.

full_day
required
boolean

Flag indicating that the shift lasts 24 hours.

id
required
string <uuid>

Shift identifier.

name
required
string

Shift name.

start_at
string <date-time>

Date and time of shift start in RFC 3339 format.

timezone
required
string

Time zone in IANA format (for example, Europe/Moscow).

updated_at
required
string <date-time>

Date and time of the shift last update in RFC 3339 format.

Response samples

Content type
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "end_at": "2019-08-24T14:15:22Z",
  • "full_day": true,
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "start_at": "2019-08-24T14:15:22Z",
  • "timezone": "string",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Updating a shift

Updates shift data by its identifier.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Shift identifier.

Request Body schema: application/json
required

New values of shift attributes.

end_at
string <date-time>

Date and time of shift end in RFC 3339 format.

full_day
boolean

Flag indicating that the shift lasts 24 hours.

name
required
string

Shift name.

start_at
string <date-time>

Date and time of shift start in RFC 3339 format.

timezone
required
string

Time zone in IANA format (for example, Europe/Moscow).

Responses

Response Schema: application/json
created_at
required
string <date-time>

Date and time of shift creation in RFC 3339 format.

end_at
string <date-time>

Date and time of shift end in RFC 3339 format.

full_day
required
boolean

Flag indicating that the shift lasts 24 hours.

id
required
string <uuid>

Shift identifier.

name
required
string

Shift name.

start_at
string <date-time>

Date and time of shift start in RFC 3339 format.

timezone
required
string

Time zone in IANA format (for example, Europe/Moscow).

updated_at
required
string <date-time>

Date and time of the shift last update in RFC 3339 format.

Request samples

Content type
application/json
{
  • "end_at": "2019-08-24T14:15:22Z",
  • "full_day": true,
  • "name": "string",
  • "start_at": "2019-08-24T14:15:22Z",
  • "timezone": "string"
}

Response samples

Content type
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "end_at": "2019-08-24T14:15:22Z",
  • "full_day": true,
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "start_at": "2019-08-24T14:15:22Z",
  • "timezone": "string",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Getting shift assignments

Returns a list of agents added to the shift and a list of shift tasks with assigned agents.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Shift identifier.

Responses

Response Schema: application/json
Array of objects (ShiftAgentAssignmentResponse)

Agent assignments to the shift.

shift_id
required
string <uuid>

Shift identifier.

Array of objects (ShiftTaskAssignmentResponse)

Task assignments.

Response samples

Content type
application/json
{
  • "agent_assignments": [
    • {
      }
    ],
  • "shift_id": "f15914ca-a3fc-41f9-a948-5ac849d2a017",
  • "task_assignments": [
    • {
      }
    ]
}

Updating shift assignments

Updates the list of agents added to the shift and the list of shift tasks with assigned agents.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Shift identifier.

Request Body schema: application/json
required

New list of agents and shift tasks with assignments.

agent_ids
Array of strings unique

Agent identifiers.

Array of objects (ShiftTaskAssignmentInput) unique

Task assignments.

Responses

Response Schema: application/json
Array of objects (ShiftAgentAssignmentResponse)

Agent assignments to the shift.

shift_id
required
string <uuid>

Shift identifier.

Array of objects (ShiftTaskAssignmentResponse)

Task assignments.

Request samples

Content type
application/json
{
  • "agent_ids": [
    • "string"
    ],
  • "task_assignments": [
    • {
      }
    ]
}

Response samples

Content type
application/json
{
  • "agent_assignments": [
    • {
      }
    ],
  • "shift_id": "f15914ca-a3fc-41f9-a948-5ac849d2a017",
  • "task_assignments": [
    • {
      }
    ]
}