Synchra.24
menu_bookDocumentation
Practical guides for setup and development

Find guides for getting started, building workflows and adding your own tools to your company workspace.

folderIntegrations and APIs

Getting a company token

How to get a provider token using the Open API token for integration with the selected company.

Machine translation

Two tokens are needed to exchange data via the Open API.:

  • Open API token confirms the access of your integration;
  • provider token specifies the company with whose data the request is being made.

Use a separate integration token created through the Synchra24 interface. Do not copy the user's login tokens from the browser or mobile application.

What to prepare

  1. Create an Open API token for the right company.
  2. Specify the ID of this company — provider_id. You can get it from the company's interface, for example, from the address of the open section of the web version.
  3. Get the company's token with the request below.

Requesting a company token

GET /api/v1/providers/user/params/{provider_id}
X-OpenAPI-Token: <OPEN_API_TOKEN>

Instead of {provider_id} specify the ID of the company for which the integration token was created.

Example:

curl --request GET \
  --url https://getway.synchra24.com/api/v1/providers/user/params/123 \
  --header 'X-OpenAPI-Token: <OPEN_API_TOKEN>'

In the response, take the value result.token. This is the company's token for the following requests.

The following queries

Transmit both headers:

X-OpenAPI-Token: <OPEN_API_TOKEN>
X-Provider-Token: <PROVIDER_TOKEN>
Content-Type: application/json

To work with another company, you need tokens issued for it. You can't substitute someone else's company ID and get access using your integration token.

Errors and security

If the request is rejected, check the correctness of the company ID, the validity period of the Open API token, the subscription, and the rights of the employee on whose behalf the integration was created.

Keep the tokens on the side of your integration and do not publish them in open source, correspondence, or screenshots. If the Open API token is disclosed, revoke it in the company settings and create a new one.

The available authorization methods and rules are given in Open API.