Brands Management
The purpose of this set of API calls is to enable brands management from the API perspective. They will allow users to manage brands for a specific account.
Create brand
This call creates a new brand 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 '{
"source": "BrandName",
"comment": "comment",
"searchPattern": false
}' 'https://api.languageweaver.com/v4/accounts/12/brands'
Windows
curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"source\": \"BrandName\",^
\"comment\": \"comment\",^
\"searchPattern\": \"false\"^
}" https://api.languageweaver.com/v4/accounts/12/brands
Access token type
User credentials - Allowed User Roles: Admin
, Linguist
HTTP Request
POST /v4/accounts/{accountId}/brands
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:
{
"source": "BrandName",
"comment": "comment",
"searchPattern": false
}
{
"source": "\\b[a-z]+est\\b",
"comment": "Match all words ending with the suffix 'est'",
"searchPattern": true
}
Format
JSON
Name | Type | Mandatory | Default value | Description |
---|---|---|---|---|
source |
string | yes | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). | |
comment |
string | no | Empty string | Description of the brand |
searchPattern |
boolean | no | false | Indicates whether the source is treated as a search pattern (regular expression) |
Response JSON:
{
"accountId": 12,
"source": "BrandName",
"comment": "comment",
"searchPattern": false
}
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 associated to the brand |
source |
string | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). |
comment |
string | Description of the brand |
searchPattern |
boolean | Indicates whether the source is treated as a search pattern (regular expression) |
Error JSON:
{
"errors":[
{
"code":1023,
"description":"Term already exists: BrandName"
}
]
}
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 brand 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 |
Get all brands for the account
This call should be used to retrieve information about all the brands of the specified account. You need to provide the account id for which you want the info as a path param.
Linux
curl -XGET -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/12/brands'
Windows
curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12/brands
Access token type
User credentials - Allowed User Roles: Admin
, Linguist
, Translator
API credentials
HTTP Request
GET /v4/accounts/{accountId}/brands?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": 1,
"pageSize": 10,
"pageNumber": 1,
"terms": [
{
"source": "BrandName",
"comment": "comment",
"searchPattern": false
}
],
"accountId": 12
}
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 associated to the brand |
source |
string | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). |
comment |
string | Description of the brand |
searchPattern |
boolean | Indicates whether the source is treated as a search pattern (regular expression) |
totalCount |
integer | Total number of brands in the account |
pageNumber |
integer | Requested page number |
pageSize |
integer | Requested page size |
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 brands 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 |
Update brand
This call is used to update a list of brands in account. The existing brand sources to update and new brands values, needs to be provided in the json body. Both brand name and comment need to be provided. Partial updates are not allowed.
Linux
curl -XPUT -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"update": [
{
"currentTerm" : {
"source": "play"
},
"updatedTerm" : {
"source": "player",
"comment": "comment",
"searchPattern": false
}
}
]
}' 'https://api.languageweaver.com/v4/accounts/12/brands'
Windows
curl -XPUT -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
"update": [^
{^
"\currentTerm\" : {^
\"source\": \"play\"^
},^
"\currentTerm\" : {^
\"source\": \"player\",^
\"comment\": \"comment\",^
\"searchPattern\": \"false\"^
}^
}^
]^
}" https://api.languageweaver.com/v4/accounts/12/brands
Access token type
User credentials - Allowed User Roles: Admin, Linguist
HTTP Request
PUT /v4/accounts/{accountId}/brands
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:
{
"update":[
{
"currentTerm":{
"source":"play"
},
"updatedTerm":{
"source":"player",
"comment":"comment",
"searchPattern": false
}
}
]
}
Format
JSON
Name | Type | Mandatory | Default value | Description | |
---|---|---|---|---|---|
update |
list | yes | List of brands to be updated | ||
currentTerm |
object | yes | Brand to be updated | ||
source |
string | yes | String specifying the source segment for brand to be updated | ||
updatedTerm |
object | yes | Brand's new information | ||
source |
string | yes | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). | ||
comment |
string | no | Empty string | Description of the brand | |
searchPattern |
boolean | no | false | Indicates whether the source is treated as a search pattern (regular expression) |
Response JSON:
{
"dictionaryId": "e8b01170-1bc4-4d61-89f7-fc2f65733442",
"accountId": 12,
"terms":[
{
"source": "player",
"comment": "comment",
"searchPattern": false
}
]
}
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 associated to the brand |
source |
string | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). |
comment |
string | Description of the brand |
searchPattern |
boolean | Indicates whether the source is treated as a search pattern (regular expression) |
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 brand 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 brand
This call is used to delete a list of existing brands. The brands names need to 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 '{\
"delete": [
{
"source": "play"
},
{
"source": "player"
}
]
}' 'https://api.languageweaver.com/v4/accounts/12/brands'
Windows
curl -XPUT -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" ^
"{^
\"delete\": [^
{^
\"source\": \"play\"^
},^
{^
\"source\": \"play\"^
}^
]^
}" https://api.languageweaver.com/v4/accounts/12/brands
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
PUT /v4/accounts/{accountId}/brands
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:
{
"delete":[
{
"source":"play"
},
{
"source":"player"
}
]
}
Format
JSON
Name | Type | Mandatory | Default value | Description | |
---|---|---|---|---|---|
delete |
list | yes | List of brands to be deleted | ||
source |
string | yes | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). |
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 brand is deleted successfully, no content is returned.
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 |
---|---|
204 | When the brand 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 |
Delete all brands for the account
This call is used to delete all brands for an account. The account id needs to be provided.
Linux
curl -XDELETE -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" \
'https://api.languageweaver.com/v4/accounts/12/brands'
Windows
curl -XDELETE -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" ^
https://api.languageweaver.com/v4/accounts/12/brands
Access token type
User credentials - Allowed User Roles: Admin
HTTP Request
DELETE /v4/accounts/{accountId}/brands
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 brands are deleted successfully no content is returned
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 |
---|---|
204 | When the brands are 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 brands in account
This call should be used to search specific brands in account. You need to provide the account id as path params.
Also in the request body the search criteria can be specified, see below.
The search matches by prefix of any property specified in the search criteria. If multiple properties are specified for search, a reunion for all matched terms will be provided (ex: source: "a" and comment: "b" all terms with source prefix "a" and all terms with comment prefix "b" will be returned).
Linux
curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'content-type: application/json' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -d '{
"source": "p",
"comment": "m"
}' 'https://api.languageweaver.com/v4/accounts/12/brands/search'
Windows
curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
\"source\": \"p\",^
\"comment\": \"m\"^
}" https://api.languageweaver.com/v4/accounts/12/brands/search
Access token type
User credentials - Allowed User Roles: Admin
, Linguist
, Translator
HTTP Request
POST /v4/accounts/{accountId}/brands/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:
{
"source": "p",
"comment": "m"
}
Format
JSON
Name | Type | Mandatory | Default value | Description |
---|---|---|---|---|
source |
string | no | Empty string | String specifying the prefix of a source term for brand item (case insensitive) |
comment |
string | no | Empty string | String specifying the prefix of the comment of brand item (case insensitive) |
Response JSON:
{
"totalCount": 2,
"pageSize": 10,
"pageNumber": 1,
"accountId": 12,
"terms": [
{
"source": "play",
"comment": "english to french",
"searchPattern": false
},
{
"source": "\\b[a-z]+est\\b",
"comment": "Match all words ending with the suffix 'est'",
"searchPattern": true
}
]
}
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 associated to the brands |
terms |
list | Brands list |
source |
string | Name of the brand. It can be a regular string or a search pattern (ECMA script regular expression). |
comment |
string | Description of the brand |
searchPattern |
boolean | Indicates whether the source is treated as a search pattern (regular expression) |
totalCount |
integer | Total number of terms matched by the search criteria in the specified dictionary |
pageNumber |
integer | Requested page number |
pageSize |
integer | Requested page size |
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 brands 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 |
Import brands
This call is used to import brands from a .xlsx file. You need to provide the account id. File will have the following structure: First populated line will be a header which contains source on first column, comment on the second one and searchPattern on the third one--> | source | comment | searchPattern |
After that, every line will contain source value on first column and comment value on the second.
- source is mandatory
- comment and searchPattern are optional
If the file contains any errors the import call will return the first 10 errors but all valid terms will be imported.
Linux
curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' \
-H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
-H "Content-type: multipart/form-data" \
-F 'content=@brands.xlsx' \
-F overwriteDuplicates=true \
'https://api.languageweaver.com/v4/accounts/12/brands'
Windows
curl -XPOST -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhUk0TVRkQk5qZzRwczovL2F"^
-H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555"^
-H "Content-type: multipart/form-data"^
-F "content=@\"brands.xlsx\""^
-F "overwriteDuplicates=true"^
https://api.languageweaver.com/v4/accounts/12/brands
Access token type
User credentials - Allowed User Roles: Admin
, Linguist
HTTP Request
POST /v4/accounts/{accountId}/brands
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
Format
multipart/form-data
Name | Type | Mandatory | Default value | Description |
---|---|---|---|---|
overwriteDuplicates |
boolean | no | false | Value specifying that imported elements with same source will overwrite or not old values |
content |
file | yes | The binary content of the file. If the imported file contains terms with duplicated source, the last one will be added to the brands with the rules specified by "overwriteDuplicates". |
Response
Error JSON:
{
"errors":[
{
"code": 18,
"description": "source from line 4 parameter is missing or is empty."
},
{
"code": 1023,
"description": "Term already exists: das"
}
]
}
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 brands are successfully imported |
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 |
Export brands
This call should be used to retrieve in a file all the brands for 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/brands/export'
Windows
curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12/brands/export
Access token type
User credentials - Allowed User Roles: Admin
, Linguist
, Translator
HTTP Request
GET /v4/accounts/{accountId}/brands/export
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) |
Format
BINARY
The binary content of all brands for the account. Binary should be converted to .xlsx
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 brands for the account 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 |