Smartling Authentication API
Smartling uses OAuth2 for [authentication](https://help.smartling.com/hc/en-us/articles/1260805176849). To access the Smartling APIs, you'll first need to authenticate with your user identifier and user secret. An access token is returned that can be attached to the header of any API request. A refresh token is also returned. To obtain your [user identifier and user secret](https://help.smartling.com/hc/en-us/articles/115004187694), log in to Smartling.com and go to **API > Create Token**. Authenticating is as simple as calling the `/api.smartling.com/auth-api/v2/authenticate` with your `userIdentifier` and `userSecret`. The access token returned is valid for 5-minutes, and is used in the header of all subsequent requests. **Example for generating your access token:** ```bash curl -X POST https://api.smartling.com/auth-api/v2/authenticate -H 'content-type: application/json' -d '{"userIdentifier": "userIdasdklj4348dk34!", "userSecret": "userSecret34i34kkd5634f"}' ``` ``` { "response": { "code": "SUCCESS", "data": { "accessToken": "eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOasdlkjn", "refreshToken": "eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJkMTdkMmEw", "expiresIn": 480, "refreshExpiresIn": 3660, "tokenType": "Bearer" } } } ``` **Example of using your access token to list all projects for your account:** ```bash curl -X GET -H "Authorization: Bearer {accessToken}" https://api.smartling.com/accounts-api/v2/accounts/{accountUid}/projects ``` ``` { "response": { "code": "SUCCESS", "data": { "totalCount": 1, "items": [{ "projectId": "df324sdf5", "projectName": "iOS Strings files", "accountUid": "ab5f1939", "archived": false, "projectTypeCode": "APPLICATION_RESOURCES", "sourceLocaleId": "en", "sourceLocaleDescription": "English" } ] } } } ```