Account Management
The purpose of this set of API calls is to enable account management from the API. Only users with special permissions will be able to call the Get and Update operations on accounts.
Get account
This call should be used to retrieve information about the account. You need to provide the account id for which you want the info.
Linux
curl -XGET -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/12'
Windows
curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
GET /v4/accounts/{accountId}
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Response JSON:
{
"accountId": 12,
"name": "Demo Account",
"active": "yes",
"description": "production",
"apiCredentials":[
{
"createdByAccountId": 1,
"createdByUserId": 1,
"createdByUserEmail": "createdBy@domain.com",
"creationDate": "2021/08/06",
"lastModifiedByAccountId": 2,
"lastModifiedByUserId": 2,
"lastModifiedByUserEmail": "lastModifiedBy@domain.com",
"lastModifyDate": "2021/09/02",
"name":"Api credentials for account",
"clientId":"fxzfNX91sdaReMDvjyjhTvkINI0",
"clientSecret":"hts3QVQ7dscsadfYoAAXD7OMRqKCrxq0LhX2N8TBbmW0aPu6RXJu0ch",
"active":"yes"
}
],
"accountSetting": {
"accountCategory": "TRIAL",
"accountCategoryFeatures": [
{
"name": "API_KEYS",
"value": 5
},
{
"name": "CHARACTERS",
"value": 20000000000
},
{
"name": "CUSTOM_LPS",
"value": 10
},
{
"name": "DELETE_CONTENT",
"value": 0
},
{
"name": "DICTIONARIES",
"value": 200
},
{
"name": "GENERIC_LPS",
"value": 2147483647
},
{
"name": "USERS",
"value": 5000
}
]
}
}
Response
Headers
| Name | Value (example) | Description |
|---|---|---|
| BeGlobal-Request-ID | dbbbc062-88a7-4783-8d52-dea795e517f4 | Unique request identifier (UUID) |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | The identifier provided in the request (UUID) |
Format
JSON
| Name | Type | Description |
|---|---|---|
accountId |
integer | Unique numeric identifier for the account |
name |
string | Account name |
active |
string | Account state |
description |
string | Account description |
apiCredentials |
list | The api credentials list |
createdByAccountId |
integer | The id of the account which created the API Credential |
createdByUserId |
integer | The id of the user who created the API Credential |
createdByUserEmail |
string | The email of the user who created the API Credential |
creationDate |
string | Creation date of the API Credential |
lastModifiedByAccountId |
integer | The id of the account which last modified the API Credential |
lastModifiedByUserId |
integer | The id of the user who last modified the API Credential |
lastModifiedByUserEmail |
string | The email of the user who last modified the API Credential |
lastModifyDate |
string | The date when the API Credential was last modified |
clientId |
string | The generated client id |
clientSecret |
string | The generated client secret |
active |
string | API Credentials state |
accountSetting |
object | Contains the account category with its features information |
Error JSON:
{
"errors":[
{
"code":1002,
"description":"account with id 12 does not exist"
}
]
}
Error Response
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 200 | When the account is returned |
| 400 | When the input data is not valid |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |
Get all users for the account
This call should be used to retrieve a list with all the users for the account. You need to provide the account id for which you want the info. In addition to the account id you should provide a page (number) and a size (for the page) parameter. Both parameters are optional, but a default value will be set if not provided.
Linux
curl -XGET -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/12/users?pageNumber=1&pageSize=3'
Windows
curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12/users?pageNumber=1&pageSize=3
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
GET /v4/accounts/{accountId}/users?pageNumber={pageNumber}&pageSize={pageSize}
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Query Parameters
| Name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
pageNumber |
int | no | 1 | Integer specifying the requested page number |
pageSize |
int | no | 10 | Integer specifying the requested page size, limited to 100 |
Response JSON:
{
"totalCount": 3,
"pageNumber": 1,
"pageSize": 3,
"accountId": 221,
"users": [
{
"userId": 1,
"firstName": "John",
"middleName": "M",
"lastName": "smith",
"email": "jsmith@domain.com",
"userRole": "admin",
"active": "yes"
},
{
"userId": 2,
"firstName": "David",
"middleName": "M",
"lastName": "Anderson",
"email": "danderson@domain.com",
"userRole": "translator",
"active": "yes"
},
{
"userId": 3,
"firstName": "Andrew",
"middleName": "M",
"lastName": "Jones",
"email": "ajones@domain.com",
"userRole": "translator",
"active": "no"
}
]
}
Response
Headers
| Name | Value (example) | Description |
|---|---|---|
| BeGlobal-Request-ID | dbbbc062-88a7-4783-8d52-dea795e517f4 | Unique request identifier (UUID) |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | The identifier provided in the request (UUID) |
Format
JSON
| Name | Type | Description |
|---|---|---|
accountId |
integer | Unique numeric identifier for the account |
userId |
integer | User ID in the system |
firstName |
string | Users's first name |
middleName |
string | Users's middle name |
lastName |
string | Users's last name |
email |
string | Users's email |
userRole |
string | Users's role |
active |
string | Users's state |
totalCount |
integer | Total number of users in account |
pageNumber |
integer | Requested page number |
pageSize |
integer | Requested page size |
Error JSON:
{
"errors":[
{
"code":1003,
"description":"No account was found"
}
]
}
Error Response
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 200 | When the users were returned |
| 400 | When the input data is not valid |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |
Create API Credentials for Account
This call is used to create a set of API credentials for the account. This will create a clientId and a clientSecret pair which can be used to authenticate apps and get tokens as presented in the Get Token With API Credentials call.
Linux
curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"name": "Demo Account",
"active": "yes",
"description": "production"
}' 'https://api.languageweaver.com/v4/accounts/1/api-credentials'
Windows
curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"name\": \"Demo Account\",^
\"active\": \"yes\",^
\"description\": \"production\"^
}" https://api.languageweaver.com/v4/accounts/1/api-credentials
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
PUT /v4/accounts/{accountId}/api-credentials
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Request Parameters
Request JSON:
{
"name": "Demo Account",
"active": "yes",
"description": "production"
}
Format
JSON
| Name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
name |
string | yes | String specifying the api credentials name | |
active |
string | no | yes | [yes/no] specify if the account is active or inactive |
Response JSON:
{
"name":"Demo Account",
"active":"yes",
"description":"production",
"accountId":1,
"apiCredentials":[
{
"name":"Api credentials for account",
"clientId":"fxzfNX91sdaReMDvjyjhTvkINI0",
"clientSecret":"hts3QVQ7dscsadfYoAAXD7OMRqKCrxq0LhX2N8TBbmW0aPu6RXJu0ch",
"active":"yes"
}
]
}
Response
Headers
| Name | Value (example) | Description |
|---|---|---|
| BeGlobal-Request-ID | dbbbc062-88a7-4783-8d52-dea795e517f4 | Unique request identifier (UUID) |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | The identifier provided in the request (UUID) |
Format
JSON
| Name | Type | Description |
|---|---|---|
name |
string | The name of the API Credentials |
clientId |
string | The generated client id |
clientSecret |
string | The generated client secret |
active |
string | API Credentials state |
Error JSON:
{
"errors":[
{
"code":1015,
"description":"Cannot create api credentials with name API DEMO for account 1"
}
]
}
Error Response
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 200 | When the api credentials are successfully created |
| 400 | When the input data is not valid |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |
Update API Credentials for Account
This call is used to update a set of API credentials for the account. The name and the active state of the credentials can be changed.
Linux
curl -XPUT -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"name": "Demo Credentials",
"active": "yes"
}' 'https://api.languageweaver.com/v4/accounts/1/api-credentials/fxzfNX91sdaReMDvjyjhTvkINI0'
Windows
curl -XPUT -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"name\": \"Demo Credentials\",^
\"active\": \"yes\"^
}" https://api.languageweaver.com/v4/accounts/1/api-credentials/fxzfNX91sdaReMDvjyjhTvkINI0
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
PUT /v4/accounts/{accountId}/api-credentials/{clientId}
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Request Parameters
Request JSON:
{
"name": "Demo Account",
"active": "yes",
"description": "production"
}
Format
JSON
| Name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
name |
string | yes | String specifying the api credentials name | |
active |
string | no | yes | [yes/no] specify if the account is active or inactive |
Response JSON:
{
"name":"Demo Account",
"active":"yes",
"description":"production",
"accountId":1,
"apiCredentials":[
{
"name":"Api credentials for account",
"clientId":"fxzfNX91sdaReMDvjyjhTvkINI0",
"clientSecret":"hts3QVQ7dscsadfYoAAXD7OMRqKCrxq0LhX2N8TBbmW0aPu6RXJu0ch",
"active":"yes"
}
]
}
Response
Headers
| Name | Value (example) | Description |
|---|---|---|
| BeGlobal-Request-ID | dbbbc062-88a7-4783-8d52-dea795e517f4 | Unique request identifier (UUID) |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | The identifier provided in the request (UUID) |
Format
JSON
| Name | Type | Description |
|---|---|---|
name |
string | The name of the API Credentials |
clientId |
string | The generated client id |
clientSecret |
string | The generated client secret |
active |
string | API Credentials state |
Error JSON:
{
"errors":[
{
"code":1015,
"description":"Cannot create api credentials with name API DEMO for account 1"
}
]
}
Error Response
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 200 | When the api credentials are successfully updated |
| 400 | When the input data is not valid |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |
Delete API Credentials for Account
This call is used to delete API credentials of an account. You need to provide a valid accountId and clientId to be able to delete the API credentials.
Linux
curl -XDELETE -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d
'https://api.languageweaver.com/v4/accounts/1/api-credentials/fxzfNX91sdaReMDvjyjhTvkINI0'
Windows
curl -XDELETE -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Content-type: application/json" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -d ^
https://api.languageweaver.com/v4/accounts/1/api-credentials/fxzfNX91sdaReMDvjyjhTvkINI0
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
DELETE /v4/accounts/{accountId}/api-credentials/{clientId}
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Response
When the API credentials are deleted successfully no content is returned
Error Response
Error JSON:
{
"errors":[
{
"code":1015,
"description":"Cannot delete api credentials with name API DEMO for account 1"
}
]
}
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 204 | When the api credentials are successfully deleted |
| 400 | When the input data is not valid |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |
Regenerate API Credentials Secret for Account
This call is used to regenerate secret for API credentials of an account. You need to provide a valid accountId and clientId to be able to regenerate the API credentials secret.
Linux
curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d
'https://api.languageweaver.com/v4/accounts/1/api-credentials/fxzfNX91sdaReMDvjyjhTvkINI0/secret'
Windows
curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Content-type: application/json" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -d ^
https://api.languageweaver.com/v4/accounts/1/api-credentials/fxzfNX91sdaReMDvjyjhTvkINI0/secret
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
POST /v4/accounts/{accountId}/api-credentials/{clientId}/secret
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Response JSON:
{
"name":"Demo Account",
"active":"yes",
"description":"production",
"accountId":1,
"apiCredentials":[
{
"name":"Api credentials for account",
"clientId":"fxzfNX91sdaReMDvjyjhTvkINI0",
"clientSecret":"qKCrxq0LhX2N8TBbhts3QVQ7dscsadfYoAAXD7OMRmW0aPu6RXJu0ch",
"active":"yes"
}
]
}
Response
Headers
| Name | Value (example) | Description |
|---|---|---|
| BeGlobal-Request-ID | dbbbc062-88a7-4783-8d52-dea795e517f4 | Unique request identifier (UUID) |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | The identifier provided in the request (UUID) |
Format
JSON
| Name | Type | Description |
|---|---|---|
name |
string | The name of the API Credentials |
clientId |
string | The generated client id |
clientSecret |
string | The generated client secret |
active |
string | API Credentials state |
Error Response
Error JSON:
{
"errors":[
{
"code":1020,
"description":"Cannot regenerate api credentials secret for clientId: fxzfNX91sdaReMDvjyjhTvkINI0 for account 1"
}
]
}
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 201 | When the api credentials secret is successfully regenerated |
| 400 | When the input data is not valid |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |
Get API Credentials self
This call should be used to retrieve information about the credentials.
Linux
curl -XGET -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/api-credentials/self'
Windows
curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/api-credentials/self
Access token type
API credentials
HTTP Request
GET /v4/accounts/api-credentials/self
Headers
| Name | Value (example) | Description |
|---|---|---|
| Authorization | Bearer asd0eXAi... | Bearer token |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | Optional unique request identifier (UUID) provided by client |
Response JSON:
{
"accountId": 12,
"clientId":"fxzfNX91sdaReMDvjyjhTvkINI0"
}
Response
Headers
| Name | Value (example) | Description |
|---|---|---|
| BeGlobal-Request-ID | dbbbc062-88a7-4783-8d52-dea795e517f4 | Unique request identifier (UUID) |
| Trace-ID | 2c0c4dda-8333-4538-983e-e098de7cf555 | The identifier provided in the request (UUID) |
Format
JSON
| Name | Type | Description |
|---|---|---|
accountId |
integer | Unique numeric identifier for the account |
clientId |
string | Unique identifier for API Credentials |
Error JSON:
{
"errors":[
{
"code": 55,
"description": "Invalid access token. The Token has expired."
}
]
}
Error Response
Format
JSON
| Name | Type | Description |
|---|---|---|
errors |
list | A list with the errors that occurred |
code |
integer | The code of the error |
description |
string | The description of the error |
Returned HTTP Codes:
| Http Code | Description |
|---|---|
| 200 | When the API credentials are returned |
| 401 | When the authentication process failed or the access token is not valid |
| 403 | Forbidden to access resource |
| 500 | Application internal error |