We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.

I agree

API - Authentication

January 1, 2018

 Issue a short-lived access token

curl -X POST -F 'email=<your-email>' -F 'password=<your password>' \
https://api.staging.sinitic.ai/login/

 

A successful request will return an encoded access token as plain text in the response body. The valid token is passed to consequent requests in X-SINITIC-TOKEN header.

 

{
    "result": {
        "company_id": "<default company id>",
        "token": "<yourshort-lived token>",
        "user_id": "<your user id>"
    }
}

Short-lived tokens expire after 30 minutes. You can switch a short-lived token to a long-lived access token that will not expire.

Issue a long-lived access token

curl -X POST -H 'X-SINITIC-TOKEN: <your short-lived token' \
https://api.staging.sinitic.ai/login/access_token/

 

A successful request will return an encoded access token as plain text in the response body.

 

{
    "result": {
        "token": "<your long-lived token"
    }
}

If you have lost your long-lived token you can issue a new token or obtain the old token as follows:

curl -X GET -H 'X-SINITIC-TOKEN: <your short-lived token' \
https://api.staging.sinitic.ai/login/access_token/
API - Authentication
API - Authentication
API - Authentication