Creating cross-authorization links via API

A cross-authorization link allows your users to open documents in the Smartcat Editor without entering their login credentials. This is how it works.

To create a cross-authorization link, you should assign a user from your team to the document first. Unassigned users are not able to open the Editor via this link. To assign a user to the dedicated document, use POST document/assign method (use documentId (documentId_languageId format), stageNumber, and the id for the Smartcat user id, and disregard other optional parameters).

See our document/assign example

Request URL: 
https://smartcat.ai/api/integration/v1/document/assign?documentId={documentId_languageId}&stageNumber=1

Headers:
Content-Type: application/json
Authorization: Basic dGVzdGFwaToxMjM0NTY=

Body:
{
  "executives": [
    {
        "id": "f8fb8870-a7fc-4ff5-8a44-34a7cf4a0c02",
    }
  ],
}

PS:
The parameter “stageNumber” defines a number of a stage in your project workflow. For example, 1 is for “Translation” if it’s the first stage, 2 is for “Editing”, and so on.

Important: the user should already have a Smartcat account and be a member of your team. You can add a member to your team via API.

Once the user is successfully assigned to the document, you can create a cross-authorization link. To do that, use the GET document/getAuthUrl method (use id for the Smartcat user id and the documentId (documentId_languageId format)). Smartcat returns a string value which contains a cross-auth URL to the document.

See our document/getAuthUrl example

Request URL: 
https://smartcat.ai/api/integration/v1/document/getAuthUrl?userId={userId}&documentId={documentId_languageId}

Headers:
Authorization: Basic ZG0wMTpRd2VydHkxMjM=

Important: the cross-auth link is valid within 30 seconds.