Labels Management
The purpose of this set of API calls is to enable labels management for a specific account.
Create label
This call creates a new label within a specific account.
Linux
curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"name": "LabelValue"
}' 'https://api.languageweaver.com/v4/accounts/12/labels'
Windows
curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"name\": \"LabelValue\"^
}" https://api.languageweaver.com/v4/accounts/12/labels
Access token type
User credentials - Allowed User Roles: Admin
API credentials
HTTP Request
POST /v4/accounts/{accountId}/labels
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": "LabelValue"
}
Format
JSON
| Name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
name |
string | yes | String specifying the name of the label. Must be below 225 characters and unique within the specified account (case insensitive). |
Response JSON:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "LabelValue",
"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 |
|---|---|---|
id |
string | Unique string identifier (UUID) for the label |
name |
string | String representing the label |
active |
string | String representing the label's state |
Error JSON:
{
"errors":[
{
"code":1100,
"description":"Label LabelValue already exists"
}
]
}
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 label is 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 label
This call should be used to update a label in the account. The unique identifier of the label must be specified as a path parameter. The value of the new label will be provided in the json body.
Linux
curl -XPUT -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"name": "LabelValue"
}' 'https://api.languageweaver.com/v4/accounts/12/labels/123e4567-e89b-12d3-a456-426614174000'
Windows
curl -XPUT -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"name\": \"LabelValue\"^
}" https://api.languageweaver.com/v4/accounts/12/labels/123e4567-e89b-12d3-a456-426614174000
Access token type
User credentials - Allowed User Roles: Admin
API credentials
HTTP Request
PUT /v4/accounts/{accountId}/labels/{labelId}
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": "LabelValue"
}
Format
JSON
| Name | Type | Mandatory | Description |
|---|---|---|---|
name |
string | yes | String specifying the name of the label. Must be below 225 characters and unique within the specified account (case insensitive). |
Response JSON:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "LabelValue",
"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 |
|---|---|---|
id |
string | Unique string identifier (UUID) for the label |
name |
string | String representing the label |
active |
string | String representing the label's state |
Error JSON:
{
"errors":[
{
"code":1002,
"description":"label with id 123e4567-e89b-12d3-a456-426614174000 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 label is 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 label
This call is used to delete a label based on its unique identifier, provided as a path parameter.
Linux
curl -XDELETE -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/12/labels/123e4567-e89b-12d3-a456-426614174000'
Windows
curl -XDELETE -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12/labels/123e4567-e89b-12d3-a456-426614174000
Access token type
User credentials - Allowed User Roles: Admin
API credentials
HTTP Request
DELETE /v4/accounts/{accountId}/labels/{labelId}
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
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) |
When the label is deleted successfully, no content is returned.
Error JSON:
{
"errors":[
{
"code":1002,
"description":"label with id 123e4567-e89b-12d3-a456-426614174000 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 |
|---|---|
| 204 | When the label is 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 |
Search labels
This call should be used in order to search specific labels for an account.
The account id must be provided as path parameter.
The search term should be specified in the request body, as below. Labels containing the search term as part of the name will be returned.
Searching with a missing/empty term will yield an error.
In addition, a page number and a page size parameter should be provided. Both parameters are optional, but a default value will be set.
Linux
curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"searchTerm": "SearchTermValue"
}' 'https://api.languageweaver.com/v4/accounts/12/labels/search'
Windows
curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"searchTerm\": \"SearchTermValue\"^
}" https://api.languageweaver.com/v4/accounts/12/labels/search
Access token type
User credentials - Allowed User Roles: Admin, Linguist, Translator
API credentials
HTTP Request
POST /v4/accounts/{accountId}/labels/search?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 |
Request Parameters
Request JSON:
{
"searchTerm": "label"
}
Format
JSON
| Name | Type | Mandatory | Default value | Description |
|---|---|---|---|---|
searchTerm |
string | no | Empty string | String specifying the text to be matched by the search (case insensitive). The length must be below 225 characters. |
Response JSON:
{
"accountId": 12,
"labels": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "firstLabel",
"active": "yes"
},
{
"id": "73ec4912-e89b-12d3-a456-426614174000",
"name": "secondLabel",
"active": "yes"
}
],
"totalCount": 2,
"pageNumber": 1,
"pageSize": 10
}
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 |
|---|---|---|
labels |
list | List of matched labels |
id |
string | Unique string identifier (UUID) for the label |
name |
string | String representing the label |
active |
string | String representing the label's state |
totalCount |
integer | Total number of labels that matched the search |
pageNumber |
integer | Requested page number |
pageSize |
integer | Requested page size |
Error JSON:
{
"errors": [
{
"code": 18,
"description": "searchTerm parameter is missing or is empty."
}
]
}
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 search was successfully processed |
| 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 |