HomeStretch Public API (1.4.4)

Download OpenAPI specification:Download

HomeStretch support: support@homestretch.ru

HomeStretch API

Authentication

ApiKeyAuth

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"

Authorization

Authorization

This method allows to get a bearer token for subsequent access to private API methods.

Token request options:

  • Pass the Authorization header with the value received as Basic base64(client_id:client_secret),
  • Pass the client_id and client_secret parameters in the request body, specifying application/x-www-form-urlencoded or application/json in the Content-Type header.

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.

Request Body schema:

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

Responses

Request samples

Content type
{
  • "client_id": "705b36a9-c095-496b-aa4a-20bc31ba1991",
  • "client_secret": "recall$shrewd9Cobalt!Style"
}

Response samples

Content type
application/json
{
  • "requestId": "705b36a9-c095-496b-aa4a-20bc31ba1991",
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Company

Get company structure

Method for obtaining company structure

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
  • "accountIds": [
    ],
  • "branches": [
    ]
}

Change company structure

Method for changing company structure

Authorizations:
Request Body schema: application/json
accountIds
Array of strings[ items [ 1 .. 48 ] characters ]
Array of objects[ items ]

Responses

Request samples

Content type
application/json
{
  • "accountIds": [
    ],
  • "branches": [
    ]
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "ownerId": "ChIJ9w44P7s0K4gRzfPYR32rXME",
  • "accountIds": [
    ],
  • "branches": [
    ]
}

Places

Get a list of places

Get a list of places

Authorizations:
query Parameters
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

Responses

Response samples

Content type
application/json
{
  • "result": [
    ],
  • "total": 19082
}

Create a place

Create a place

Authorizations:
Request Body schema: application/json
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)

Responses

Request samples

Content type
application/json
{
  • "id": "EGpTdIRP5cuLuzMMDY6O",
  • "title": "Important place",
  • "tags": [
    ],
  • "contractorId": "cLaEEcGpI16RbkLAutLB",
  • "comment": "Reception number: 02",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
  • "contractorId": "6c42de8c-f068-46be-9e35-b0070614ec81",
  • "title": "Important place",
  • "tags": [
    ],
  • "comment": "Reception number: 02",
  • "location": {
    },
  • "createdAt": "2018-04-03T02:17:14.756Z",
  • "updatedAt": "2018-04-03T02:17:14.756Z"
}

Remove a place

Remove a place

Authorizations:
path Parameters
id
string
Example: 9EQbnyYRf6VVwwQZOQAA

Place ID

Responses

Response samples

Content type
application/json
{
  • "message": "Credentials are required",
  • "code": "CredentialsRequired"
}

Update a place

Update a place

Authorizations:
Request Body schema: application/json
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

Responses

Request samples

Content type
application/json
{
  • "title": "Important place",
  • "tags": [
    ],
  • "contractorId": "cLaEEcGpI16RbkLAutLB",
  • "comment": "Reception number: 02",
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "id": "ChIJ9w44P7s0K4gRzfPYR32rXME",
  • "contractorId": "6c42de8c-f068-46be-9e35-b0070614ec81",
  • "title": "Important place",
  • "tags": [
    ],
  • "comment": "Reception number: 02",
  • "location": {
    },
  • "createdAt": "2018-04-03T02:17:14.756Z",
  • "updatedAt": "2018-04-03T02:17:14.756Z"
}

Get a place

Get a place

Authorizations:
path Parameters
id
string
Example: 9EQbnyYRf6VVwwQZOQAA

Place ID

Responses