GroupDocs.Translation Cloud follows industry standards and best practices to keep your data secure. All communication with GroupDocs.Translation Cloud REST API is done using JWT authentication, which provides an open-standard, highly secure way to exchange information.
Getting an access token
Time-limited JWT tokens are generated using Client ID and Client Secret credentials that are specific for each application. To obtain the credentials:
Give the application an easily recognizable name so it can be quickly found in a long list, and provide an optional detailed description.
Create the cloud storage by clicking the plus icon and following the required steps. You can also reuse existing storage, if available. GroupDocs.Translation Cloud uses its own internal storage, so you can provide the bare minimum storage options:
Type: Internal storage
Storage name: Any name you like
Storage mode: Retain files for 24 hours
Click Save button.
Click the newly created application and copy the values from Client Id and Client Secret fields.
Note
Keep your credentials safe! If you feel that they might be compromised, regenerate them immediately.
Now request an access token by sending the POST request to https://id.groupdocs.cloud/connect/token with the following parameters in the request body (x-www-form-urlencoded):
grant_type - must be client_credentials
client_id - the value from Client Id field.
client_secret - the value from Client Secret field.
The access token is returned in access_token property of the response JSON and will be valid for the number of seconds specified in the expires_in property of the response JSON. If it has expired, request a new one using the same API call.
Authorizing REST API requests
To authorize your requests to GroupDocs.Translation Cloud API, pass the access token in Authorization header of each request (Bearer authentication):
curl --location --request POST 'https://api.groupdocs.cloud/v2.0/translation/text'\
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...J5xlBi7mQfuNMzxpjUGVCUOOuGEd6iuJCbMaGanlhA9g'
Authorizing SDK requests
The SDKs greatly simplify all operations for obtaining an access token and authorizing requests. Just pass in the values from the Client ID and Client Secret fields when initializing the translation API and it will do the rest for you.
Configurationconfig=newConfiguration();/** Authorize your requests to GroupDocs.Translation Cloud */config.OAuthFlow=OAuthFlow.APPLICATION;config.OAuthClientId="YOU_CLIENT_ID";config.OAuthClientSecret="YOU_CLIENT_SECRET";/** Initialize GroupDocs.Translation API */config.BasePath="https://api.groupdocs.cloud/v2.0/translation";TranslationApiapiInstance=newTranslationApi(config);
// Authorize your requests to GroupDocs.Translation Cloud
StringbasePath="https://api.groupdocs.cloud/v2.0/translation";StringcliendId="YOUR_CLIENT_ID";StringclientSecret="YOUR_CLIENT_SECRET";// Initialize GroupDocs.Translation API
ApiClientdefaultClient=newApiClient(basePath,cliendId,clientSecret,null);TranslationApitranslationApi=newTranslationApi(defaultClient);