Download OpenAPI specification:Download
HomeStretch API
The token (Bearer Authentication), which must be specified in the header for each request.
A unique token for a user account must be obtained using the POST /auth
method.
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | bearer |
Bearer format | "JWT" |
This method allows to get a bearer token for subsequent access to private API methods.
Token request options:
The received token will have an infinite TTL. Contact our support to get the client_id and client_secret. Specify the name of your company.
Obtaining a JWT token by id and client's secret key
client_id required | string Client ID |
client_secret required | string Client's secret key |
{- "client_id": "705b36a9-c095-496b-aa4a-20bc31ba1991",
- "client_secret": "recall$shrewd9Cobalt!Style"
}
{- "requestId": "705b36a9-c095-496b-aa4a-20bc31ba1991",
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
{- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
], - "branches": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
], - "branches": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
], - "branches": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
]
}
]
}
]
}
]
}
Method for changing company structure
accountIds | Array of strings[ items [ 1 .. 48 ] characters ] |
Array of objects[ items ] |
{- "accountIds": [
- "dqwbnyYRf6VqwdpoQZOQwef",
- "wegbnyYRfroigjwQZOopge"
], - "branches": [
- {
- "id": "RXLgFjcpDkE9XSs3wXp5",
- "name": "Head",
- "ownerId": "9EQbnyYRf6VVwwQZOQAA",
- "branches": [
- {
- "id": "RXLgFjcpOIj9XSs3wXp5",
- "name": "Sub 1",
- "ownerId": "9EQbnyYRf6VVwwQZOQAA",
- "accountIds": [
- "dqwbnyYRf6VqwdpoQZOQwef",
- "wegbnyYRfroigjwQZOopge"
], - "branches": [
- {
- "id": "WdfeFjcpDkE9XSs3wXp5",
- "name": "Sub sub 1",
- "ownerId": "9EQbnyYRf6VVwwQZOQAA",
- "accountIds": [
- "CWeoiOWCIjwoWIEFOW",
- "WFIJWEOfJWEOifWEFIUL"
]
}
]
}, - {
- "id": "PlfeFjcpDkE9XSs3wXp5",
- "name": "Sub 2",
- "ownerId": "9EQbnyYRf6VVwwQZOQAA",
- "accountIds": [
- "DWUQiuqhwdiqufhIHlIWUefh",
- "WfunewkjnwiwUNWLCeiwbelf"
]
}
]
}
]
}
{- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
], - "branches": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
], - "branches": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
], - "branches": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "name": "string",
- "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "accountIds": [
- "ChIJ9w44P7s0K4gRzfPYR32rXME"
]
}
]
}
]
}
]
}
Get a list of places
sort | string Value: "title" |
sortDir | string Enum: "desc" "asc" Sorting direction |
skip | integer Default: 0 The number of items to skip before fetching the result |
limit | integer <= 150 Default: 25 The number of items in the sample |
{- "result": [
- {
- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "contractorId": "6c42de8c-f068-46be-9e35-b0070614ec81",
- "title": "Important place",
- "tags": [
- "Important place"
], - "comment": "Reception number: 02",
- "location": {
- "coordinates": {
- "lat": 55.692789,
- "lng": 37.554554
}, - "addresses": [
- {
- "locale": "ru",
- "address": "Moscow, Znamenka st., 19"
}
], - "arrivalDuration": 900,
- "departureDuration": 300,
- "transportRestrictions": [
- "14T"
]
}, - "createdAt": "2018-04-03T02:17:14.756Z",
- "updatedAt": "2018-04-03T02:17:14.756Z"
}
], - "total": 19082
}
Create a place
id | string [ 1 .. 48 ] characters Entity ID. This field is optional. If the identifier is not passed, the UUID V4 will be generated |
title required | string Place name |
contractorId | string Contractor identifier which this place belongs to |
comment | string Comment or additional information to the place |
required | object Location, geographical position |
tags | Array of strings Tags (for example, to indicate the type of business) |
{- "id": "EGpTdIRP5cuLuzMMDY6O",
- "title": "Important place",
- "tags": [
- "Important place"
], - "contractorId": "cLaEEcGpI16RbkLAutLB",
- "comment": "Reception number: 02",
- "location": {
- "coordinates": {
- "lat": 55.83730739,
- "lng": 37.62006685
}, - "addresses": [
- {
- "address": "Moscow, Hidden st., 999"
}
]
}
}
{- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "contractorId": "6c42de8c-f068-46be-9e35-b0070614ec81",
- "title": "Important place",
- "tags": [
- "Important place"
], - "comment": "Reception number: 02",
- "location": {
- "coordinates": {
- "lat": 55.692789,
- "lng": 37.554554
}, - "addresses": [
- {
- "locale": "ru",
- "address": "Moscow, Znamenka st., 19"
}
], - "arrivalDuration": 900,
- "departureDuration": 300,
- "transportRestrictions": [
- "14T"
]
}, - "createdAt": "2018-04-03T02:17:14.756Z",
- "updatedAt": "2018-04-03T02:17:14.756Z"
}
Update a place
title | string Place name |
contractorId | string Contractor identifier which this place belongs to |
comment | string Comment or additional information to the place |
tags | Array of strings Tags (for example, to indicate the type of business) |
object Location, geographical position |
{- "title": "Important place",
- "tags": [
- "Important place"
], - "contractorId": "cLaEEcGpI16RbkLAutLB",
- "comment": "Reception number: 02",
- "location": {
- "coordinates": {
- "lat": 55.83730739,
- "lng": 37.62006685
}, - "addresses": [
- {
- "address": "Moscow, Hidden st., 999"
}
]
}
}
{- "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
- "contractorId": "6c42de8c-f068-46be-9e35-b0070614ec81",
- "title": "Important place",
- "tags": [
- "Important place"
], - "comment": "Reception number: 02",
- "location": {
- "coordinates": {
- "lat": 55.692789,
- "lng": 37.554554
}, - "addresses": [
- {
- "locale": "ru",
- "address": "Moscow, Znamenka st., 19"
}
], - "arrivalDuration": 900,
- "departureDuration": 300,
- "transportRestrictions": [
- "14T"
]
}, - "createdAt": "2018-04-03T02:17:14.756Z",
- "updatedAt": "2018-04-03T02:17:14.756Z"
}