Get account details via API

Let's start with receiving details of your account. You can do that with a GET account request that will respond to you with an account id, name, type (personal or corporate), and another type (for example, LSP or EndCustomer).

See our account example

Request URL: 
https://smartcat.ai/api/integration/v1/account

Headers:
Authorization: Basic ZG0wMTpRd2VydHkxMjM=

Response:
{
  "id": "91c6d7fa-4677-490b-a048-6f418e9ee55e",
  "name": "MyAccount",
  "isPersonal": false,
  "type": "LSP"
}

If your account type is LSP, you can also get a list of services from your LSP profile with a GET account/lsp/services end point.

See our account/lsp/services example

Request URL: 
https://smartcat.ai/api/integration/v1/account/lsp/services

Headers:
Authorization: Basic ZG0wMTpRd2VydHkxMjM=

Response:
[
  {
     "sourceLanguage": "en",
     "targetLanguage": "ru",
     "name": "Translation",
     "pricePerUnit": 0.5,
     "pricePerUnitCurrency": "usd",
     "serviceTypes": [
     "translation"
     ],
     "specializations": []
  },
  {
     "sourceLanguage": "ru",
     "targetLanguage": "es-AR",
     "name": "Translation",
     "pricePerUnit": 0.5,
     "pricePerUnitCurrency": "usd",
     "serviceTypes": [
     "translation"
     ],
     "specializations": []
  }
]

PS:
You can also get a list of services for a specific language pair; a request in that case will look like the following:
https://smartcat.ai/api/integration/v1/account/lsp/services?sourceLanguage=en&targetLanguage=fr

Next, with a GET account/mtengines method check what machine translation engines are added to your account. 

See our account/mtengines example

Request URL: 
https://smartcat.ai/api/integration/v1/account/mtengines

Headers:
Authorization: Basic ZG0wMTpRd2VydHkxMjM=

Response:
[
  {
     "id": "754204d5-3c49-4bc0-a5aa-28adf2e34b98",
     "name": "Google"
  },
  {
     "id": "f2aefafe-87b7-49a2-9c51-17858e3dec52",
     "name": "Google Neural Machine Translation"
  },
  {
     "id": "a22b2732-1fca-3ab5-da9e-c95ab68affff",
     "name": "Microsoft Translator"
  }
]

If you want to know more about your team member, get a team member's profile using a member's Smartcat id with GET account/myteam/{userid}, or you can get a team member's profile using a member's external id with GET account/myteam/

See our account/myteam/{userId} example

Request URL: 
https://smartcat.ai/api/integration/v1/account/myteam/7aaee713-1810-4dcf-9ec8-c7b4832254e2

Headers:
Authorization: Basic dGVzdGFwaToxMjM0NTY=

Response:
{
  "id": "7aaee713-1810-4dcf-9ec8-c7b4832254e2",
  "email": "a.nichols@mailforspam.com",
  "firstName": "Aleksandra",
  "lastName": "Nichols",
  "services": [
     {
     "serviceType": "translation",
     "sourceLanguage": "en",
     "targetLanguage": "es",
     "pricePerUnit": 0.015,
     "currency": "usd",
     "specializations": []
     }
  ]
}

See our account/myteam example

Request URL: 
https://smartcat.ai/api/integration/v1/account/myteam?externalId=1150

Headers:
Authorization: Basic dGVzdGFwaToxMjM0NTY=

Response:
{
  "id": "7aaee713-1810-4dcf-9ec8-c7b4832254e2",
  "email": "a.nichols@mailforspam.com",
  "firstName": "Aleksandra",
  "lastName": "Nichols",
  "externalId": "1150",
  "services": [
     {
     "serviceType": "translation",
     "sourceLanguage": "en",
     "targetLanguage": "es",
     "pricePerUnit": 0.015,
     "currency": "usd",
     "specializations": []
     }
  ]
}

You might also want to know information about clients added to your account, and there is a GET client/{clientId} method to help you out.

See our client/{clientId} example

Request URL: 
https://smartcat.ai/api/integration/v1/client/36cbed44-eeea-414e-9769-6b9f2002885c

Headers:
Authorization: Basic ZG0wMTpRd2VydHkxMjM=

Response:
{
"id": "36cbed44-eeea-414e-9769-6b9f2002885c",
"name": "Client",
"netRate": {
  "id": "5c0eae836baff30a2084e25d",
  "name": "NetRate",
  "newWordsRate": 1,
  "repetitionsRate": 0,
  "tmMatchRates": [
     {
        "fromQuality": 50,
        "toQuality": 74,
        "value": 1
     },
     {
        "fromQuality": 75,
        "toQuality": 84,
        "value": 1
     },
     {
       "fromQuality": 85,
       "toQuality": 94,
       "value": 0.9
     },
     {
       "fromQuality": 95,
       "toQuality": 99,
       "value": 0.8
     },
     {
       "fromQuality": 100,
       "toQuality": 100,
       "value": 0
     },
     {
        "fromQuality": 101,
        "toQuality": 101,
        "value": 0
     },
     {
        "fromQuality": 102,
        "toQuality": 102,
        "value": 0
     }
  ]
}
}

The response displays a client name, client id and details about a net rate attached to the client. "fromQuality" is a bottom value of a TM match, "toQuality" is a top value of a TM match, and a value is a payment rate. For example, value 0.9 means that TM matches will be paid according to the 90% of the full per-word rate.