Shifts
Public API (0.0.0)
2GIS GeoFlow Public API
Getting a list of shifts
Returns a page with a list of shifts for the specified period.
Authorizations:
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
- 200
- 400
- 401
- 500
{- "cursor": {
- "next": "string",
- "prev": "string"
}, - "items": [
- {
- "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"
}
]
}Creating a shift
Creates a shift.
Authorizations:
Request Body schema: application/jsonrequired
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, |
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, |
| updated_at required | string <date-time> Date and time of the shift last update in RFC 3339 format. |
Request samples
- Payload
{- "end_at": "2019-08-24T14:15:22Z",
- "full_day": true,
- "name": "string",
- "start_at": "2019-08-24T14:15:22Z",
- "timezone": "string"
}Response samples
- 200
- 400
- 401
- 500
{- "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:
path Parameters
| id required | string <uuid> Shift identifier. |
Responses
Response samples
- 400
- 401
- 404
- 500
{- "error_code": "string",
- "message": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "violations": [
- {
- "error_code": "string",
- "field": "string",
- "message": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
]
}Getting a shift
Returns shift data by its identifier.
Authorizations:
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, |
| updated_at required | string <date-time> Date and time of the shift last update in RFC 3339 format. |
Response samples
- 200
- 400
- 401
- 404
- 500
{- "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:
path Parameters
| id required | string <uuid> Shift identifier. |
Request Body schema: application/jsonrequired
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, |
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, |
| updated_at required | string <date-time> Date and time of the shift last update in RFC 3339 format. |
Request samples
- Payload
{- "end_at": "2019-08-24T14:15:22Z",
- "full_day": true,
- "name": "string",
- "start_at": "2019-08-24T14:15:22Z",
- "timezone": "string"
}Response samples
- 200
- 400
- 401
- 404
- 500
{- "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:
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
- 200
- 400
- 401
- 404
- 500
{- "agent_assignments": [
- {
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978"
}
], - "shift_id": "f15914ca-a3fc-41f9-a948-5ac849d2a017",
- "task_assignments": [
- {
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "created_at": "2019-08-24T14:15:22Z",
- "task_id": "736fde4d-9029-4915-8189-01353d6982cb",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Updating shift assignments
Updates the list of agents added to the shift and the list of shift tasks with assigned agents.
Authorizations:
path Parameters
| id required | string <uuid> Shift identifier. |
Request Body schema: application/jsonrequired
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
- Payload
{- "agent_ids": [
- "string"
], - "task_assignments": [
- {
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "task_id": "736fde4d-9029-4915-8189-01353d6982cb"
}
]
}Response samples
- 200
- 400
- 401
- 404
- 500
{- "agent_assignments": [
- {
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978"
}
], - "shift_id": "f15914ca-a3fc-41f9-a948-5ac849d2a017",
- "task_assignments": [
- {
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "created_at": "2019-08-24T14:15:22Z",
- "task_id": "736fde4d-9029-4915-8189-01353d6982cb",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}