RWS Logo
Show / Hide Table of Contents

Brands

Retrieve brand entries

Example Request:

curl "https://controller-host:8001/api/v2/brands" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-H "Content-Type: multipart/form-data" \

Example Response:

{
    "brands": [
        {
            "source": "\\b[a-z]+est\\b",
            "target": "",
            "comment": "Preserve all source words ending in 'est'",
            "isSearchPatternSource": true,
            "disabled": true
        },
        {
            "source": "test",
            "target": "best",
            "comment": "Output 'test' as 'best'",
            "isSearchPatternSource": false,
            "disabled": false
        }
    ],
    "page": 1,
    "perPage": 25,
    "totalPages": 1,
    "totalItems": 2
}

Retrieve a list of brand entries.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

GET /api/v2/brands

Request Parameters

Name Type Description Default Value
source (optional) string Filter by wildcard source match
target (optional) string Filter by wildcard target match
comment (optional) string Filter by wildcard comment match
isSearchPatternSource (optional) boolean Filter by search pattern sources
disabled (optional) boolean Filter by disabled brands
page (optional) int Page number to return 1
perPage (optional) int Number of brand entries to return per page 25

Returns

Returns a list of brands a brand object with the following attributes.

Name Type Description
brands array of objects List of brand entries as an array of Brand objects
page int Page number returned
perPage int Number of brand entries returned per page
totalPages int Total number of pages available
totalItems int Total number of brand entries

Export brand entries

Example Request:

curl "https://controller-host:8001/api/v2/brands/export" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-H "Content-Type: multipart/form-data" \
	-F exportFormat="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

Export all brands as an XML or spreadsheet.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

GET /api/v2/brands/export

Request Parameters

Name Type Description Default Value
exportFormat (optional) string Format type to export (supports text/xml or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) text/xml

Returns

Returns brands in desired format.

Create a brand entry

Example Request:

curl "https://controller-host:8001/api/v2/brands" \
	-X POST \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-d disabled="true" \
	-d isSearchPatternSource="true" \
	-d target="test" \
	--data-urlencode comment="Output all words ending in 'est' as 'test'" \
	--data-urlencode source="\b[a-z]+est\b"

Example Response:

{
    "brands": [
        {
            "source": "\\b[a-z]+est\\b",
            "target": "test",
            "comment": "Output all words ending in 'est' as 'test'",
            "isSearchPatternSource": true,
            "disabled": true
        }
    ],
    "page": 1,
    "perPage": 25,
    "totalPages": 1,
    "totalItems": 1
}

Create a single brand entry.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

POST /api/v2/brands

Request Parameters

Name Type Description Default Value
source string Source brand entry preserves source in translation output; can be literal string or a search pattern (ECMAScript regular expression syntax)
target (optional) string Optional target brand entry; if empty, source will be preserved in translation output, else translation output will contain target entry
comment (optional) string Optional comment brand entry
isSearchPatternSource (optional) boolean Optional isSearchPatternSource brand entry; set true if source is a search pattern (ECMAScript regular expression syntax) false
disabled (optional) boolean Optional disabled brand entry; set true to disable brand entry false

Returns

Returns the brand object with the following attributes.

Name Type Description
source string Brand entry source
target string Brand entry target
comment string Brand entry comment
isSearchPatternSource boolean Whether source is a search pattern
disabled boolean Whether brand entry is disabled

Import brand entries

Example Request:

curl "https://controller-host:8001/api/v2/brands/import" \
	-X POST \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-H "Content-Type: multipart/form-data" \
	-F file="@<file>"
	-F importFormat="text/xml"

Import an XML or spreadsheet file of brand entries.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

POST /api/v2/brands/import

Request Parameters

Name Type Description Default Value
file file File of brand entries that is in XML or XLSX format
importFormat (optional) string Format type of import (supports text/xml or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet). Edge will attempt to determine format type if none is provided.

Returns

Returns the number of brands imported.

Update a brand entry

Example Request:

curl "https://controller-host:8001/api/v2/brands" \
	-X PUT \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-H "Content-Type: multipart/form-data" \
	-F comment="Output 'test' as 'best'"
	-F disabled="true"
	-F isSearchPatternSource="true"
	-F originalSource="test"
	-F source="\b[a-z]+est\b"
	-F target="best"

Example Response:

{
    "brands": [
        {
            "source": "\\b[a-z]+est\\b",
            "target": "test",
            "comment": "Output all words ending in 'est' as 'test'",
            "isSearchPatternSource": true,
            "disabled": true
        }
    ],
    "page": 1,
    "perPage": 25,
    "totalPages": 1,
    "totalItems": 1
}

Update a single brand entry.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

PUT /api/v2/brands

Request Parameters

Name Type Description Default Value
originalSource string Source of brand entry to update
source (optional) string Optional updated source value of brand entry
target (optional) string Optional updated target value of brand entry
comment (optional) string Optional updated comment value of brand entry
isSearchPatternSource (optional) boolean Optional updated isSearchPatternSource value of brand entry
disabled (optional) boolean Optional updated disabled value of brand entry

Returns

Returns the brand object with the following updated attributes.

Name Type Description
source string Brand entry source
target string Brand entry target
comment string Brand entry comment
isSearchPatternSource boolean Whether source is a search pattern
disabled boolean Whether brand entry is disabled

Delete brand entries

Example Request:

curl "https://controller-host:8001/api/v2/brands" \
	-X DELETE \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-H "Content-Type: multipart/form-data" \
	-F source="test"

Delete a list of brand entries.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

DELETE /api/v2/brands

Request Parameters

Name Type Description Default Value
source array of strings List of source entries to delete

Returns

Returns the number of deleted brand entries.

Delete brand entries

Example Request:

curl "https://controller-host:8001/api/v2/brands/batch-delete" \
	-X DELETE \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-H "Content-Type: multipart/form-data" \

Delete a list of brand entries.

This endpoint is restricted to the following roles: admin, super admin

HTTP Request

DELETE /api/v2/brands/batch-delete

Request Parameters

Name Type Description Default Value
source (optional) string Delete brands by wildcard source match
target (optional) string Delete brands by wildcard target match
comment (optional) string Delete brands entries by wildcard comment match
isSearchPatternSource (optional) boolean Delete brands that are search pattern sources
disabled (optional) boolean Delete disabled brand entries

Returns

Returns the number of deleted brand entries.

In this page
Back to top