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

I agree

Sinitic selected to share multilingual player experience automation at SiGMA'19

November 27, 2019

Msida, Malta

Authenticating the Translate API

1. To issue a short-lived access token, run this command:

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

2. A successful request will return an encoded access token as plain text in the response body. Save the valid token and send future requests with this valid token in the X-SINITIC-TOKEN header:

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

3. Short-lived tokens expire after 30 minutes. You can switch a short-lived token to a long-lived token with the following command:

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

 

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

{
    "result": {
        "token": "
    }
}

Note: 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>' \</your short-lived token>
https://api.staging.sinitic.ai/login/access_token/

Using the Translate API

You can utilize trained translation models via the Translate API with the following steps:

1. In order to to send the correct POST request you'll need to obtain the model ID.

2. Send a POST request to the following URL and set a valid access token in X-SINITIC-TOKEN header: https://api.staging.sinitic.ai/amt/model/<model_id>/inference

3. The POST request should be done with a JSON body in the following format:

{
    "source": "intermediate",
    "texts": [
        "Hello!",
        "How are you?"
    ]
}

 

Request Body

Response Body

The response body is a JSON array with results for each text in the input array.

{
    "results": [
        {
            "source_text": "Hello!",
            "target_text": "Hej!"
        },
        {
            "source_text": "how are you?",
            "target_text": "Hur mår du?"
        }
    ]
}
Sinitic selected to share multilingual player experience automation at SiGMA'19
Sinitic selected to share multilingual player experience automation at SiGMA'19
Sinitic selected to share multilingual player experience automation at SiGMA'19