Brands

Manage brands

Retrieving all brands

get

Retrieves all brands created by the tenant.


Required scopes

No specific scopes are required.

Authorizations
Query parameters
qstringOptional

A standard query parameter is used to search for specific values.

  • Searching for items by string-based properties:
    • By field value: q=name:brand_one, where name is the field name and brand_one is its desired value.
    • By localized field value: q=name.en:brand_one, where name is the field name, en is a language code, and brand_one is the field value expressed in the specified language. Note: This query works only for localized fields stored in the map format, where key is the language code and value is the translation to a particular language.
  • Searching for items by a number-based property:
    • With a specific value: q=metadata.version:2
    • With a value greater than: q=metadata.version:>1
    • With a value lower than: q=metadata.version:<3
    • With a value greater than or equal to: q=metadata.version:>=1
    • With a value lower than or equal to: q=metadata.version:<=2
    • With a value within a range of values: q=metadata.version:(>=1 AND <=2)
      where metadata.version is the name of the number-based field, and 2 is it's querying value.
  • Searching for items by a date-based property: All numer-based property queries are also valid for dates. In that case, the date should be placed within double quotes: q=metadata.createdAt:(>="2021-05-18T07:27:27.455Z" AND <"2021-05-20T07:27:27.455Z")
  • Searching for items with a nonexistent or empty property: q=localizedDescription.en:null, where localizedDescription.en is the field that has its value set to null.
  • Searching for items with an existing property: q=localizedDescription:exists, where localizedDescription is the field that has a non-empty value.
  • Searching for items by multiple specific values: q=id:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494), where id is the field name, and strings within the bracket are the desired values.
  • Searching for items by multiple fields: q=id:5c3325baa9812100098ff48f name:brand_one where id and name are field names. All objects that contain the specified values are returned. Multiple fields (separated by space) can be specified. Multiple values for each field can also be specified in a format presented earlier.
  • Searching for items with string-based properties conforming to a regex: q=name:~_on or q=name:(~brand on) - in case of searching for strings with space, where name is the name of field and _on or brand on is its querying regex.
  • Searching for items with a localized string-based property conforming to a regex: localizedName.en:~(_on) - where localizedName is the localized field name, en is a desired language, and _on is a search term.
Example: name:{brandName}
pageSizestringOptional

The number of documents to be retrieved per page.

pageNumberstringOptional

The page number to be retrieved. The size of the pages should be specified by the pageSize parameter.

sortstringOptional

List of properties used to sort the results, separated by colons.

fieldsstringOptional

Fields to be returned in the response.

Header parameters
Accept-LanguagestringOptional

The language or multiple languages acceptable for the response. Defines language(s) of the localized fields that should be returned in the response body. If set to *, the response body will contain translations into all languages specified in the tenant configuration. The specified language needs to be defined in the Configuration Service, under the project_lang key.

Note: If not specified, the localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7
X-Total-CountbooleanOptional

Flag indicating whether the total number of retrieved results should be returned.

Responses
200
The brands have been successfully retrieved.
application/json
get
GET /brands HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "name": "Brand_1",
    "description": "Description of Brand_1 in HTML.",
    "localizedName": {
      "en": "Brand one",
      "de": "Marke einz"
    },
    "localizedDescription": {
      "en": "Description of <strong>Brand one</strong> in HTML.",
      "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
    },
    "image": "https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id",
    "cloudinaryUrl": "tenant/brands/media_Id",
    "metadata": {
      "createdAt": "2015-01-17T23:00:52.364Z",
      "modifiedAt": "2015-01-17T23:00:52.364Z",
      "version": 3
    },
    "id": "55421f3b6ecea7b1a3b73d26"
  },
  {
    "name": "Brand_2",
    "description": "Description of Brand_2 in HTML.",
    "localizedName": {
      "en": "Brand two",
      "de": "Marke zwei"
    },
    "localizedDescription": {
      "en": "Description of <strong>Brand two</strong> in HTML.",
      "de": "Beschreibung der <strong>Marke zwei</strong> in HTML."
    },
    "image": "https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id",
    "cloudinaryUrl": "tenant/brands/media_Id",
    "metadata": {
      "createdAt": "2015-01-17T23:00:52.364Z",
      "modifiedAt": "2015-01-17T23:00:52.364Z",
      "version": 3
    },
    "id": "55421f3b6ecea7b1a3b73d26"
  }
]

Adding a new brand

post

Creates a new brand.


Required scopes

  • brand.brand_manage

Authorizations
Header parameters
Content-LanguagestringOptional

Defines the language in which the localized fields are specified. If set to *, the request body may contain translations into all languages specified in the tenant configuration. The specified language need to be defined in the Configuration Serivce under project_lang key.

Note: If not specified, localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: en
Body
idstringOptional

Unique identifier of a brand.

Example: 55421f3b6ecea7b1a3b73d26
namestringOptional

Brand name.

Example: Brand one
descriptionstringOptional

Brand description.

Example: Description of <strong>Haribo</strong> in HTML.
imagestringOptionalDeprecated

Link to the associated media file. This field is deprecated. Media assignment should be done through media-service.

Example: https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id
cloudinaryUrlstringOptionalDeprecated

Id of the associated media file. This field is deprecated. Media assignment should be done through media-service.

Example: tenant/brands/media_Id
Responses
201
The brand has been successfully created.
application/json
post
POST /brands HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 313

{
  "id": "55421f3b6ecea7b1a3b73d26",
  "name": "Brand one",
  "description": "Description of <strong>Haribo</strong> in HTML.",
  "localizedName": {
    "en": "Brand one",
    "de": "Marke einz"
  },
  "localizedDescription": {
    "en": "Description of <strong>Brand one</strong> in HTML.",
    "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
  }
}
{
  "name": "Brand_2",
  "description": "Description of Brand_2 in HTML.",
  "localizedName": {
    "en": "Brand one",
    "de": "Marke einz"
  },
  "localizedDescription": {
    "en": "Description of <strong>Brand one</strong> in HTML.",
    "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
  },
  "image": "https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id",
  "metadata": {
    "createdAt": "2015-01-17T23:00:52.364Z",
    "modifiedAt": "2015-01-17T23:00:52.364Z",
    "version": 1
  },
  "id": "55421f3b6ecea7b1a3b73d26"
}

Retrieving a brand

get

Retrieves details of a specified brand.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
brandIdstringRequired

Unique identifier of a brand.

Header parameters
Accept-LanguagestringOptional

The language or multiple languages acceptable for the response. Defines language(s) of the localized fields that should be returned in the response body. If set to *, the response body will contain translations into all languages specified in the tenant configuration. The specified language needs to be defined in the Configuration Service, under the project_lang key.

Note: If not specified, the localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7
Responses
200
Brand successfully retrieved.
application/json
get
GET /brands/{brandId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "name": "Haribo",
  "description": "Description of Brand_2 in HTML.",
  "localizedName": {
    "en": "Brand one",
    "de": "Marke einz"
  },
  "localizedDescription": {
    "en": "Description of <strong>Brand one</strong> in HTML.",
    "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
  },
  "image": "https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id",
  "cloudinaryUrl": "tenant/brands/media_Id",
  "metadata": {
    "createdAt": "2015-01-17T23:00:52.364Z",
    "modifiedAt": "2015-01-17T23:00:52.364Z",
    "version": 3
  },
  "id": "55421f3b6ecea7b1a3b73d26"
}

Updating a brand

put

Updates a specified brand by replacing all of its existing data with data from the request body.


Required scopes

  • brand.brand_manage

Authorizations
Path parameters
brandIdstringRequired

Unique identifier of a brand.

Header parameters
Content-LanguagestringOptional

Defines the language in which the localized fields are specified. If set to *, the request body may contain translations into all languages specified in the tenant configuration. The specified language need to be defined in the Configuration Serivce under project_lang key.

Note: If not specified, localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: en
Body
namestringOptional

Brand name.

Example: Brand one
descriptionstringOptional

Brand description.

Example: Description of <strong>Haribo</strong> in HTML.
imagestringOptionalDeprecated

Link to the associated media file. This field is deprecated. Media assignment should be done through media-service.

Example: https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id
cloudinaryUrlstringOptionalDeprecated

Id of the associated media file. This field is deprecated. Media assignment should be done through media-service.

Example: {tenant}/brands/{media_Id}
Responses
200
The brand has been successfully updated.
application/json
put
PUT /brands/{brandId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 306

{
  "name": "Brand one",
  "description": "Description of <strong>Haribo</strong> in HTML.",
  "localizedName": {
    "en": "Brand one",
    "de": "Marke einz"
  },
  "localizedDescription": {
    "en": "Description of <strong>Brand one</strong> in HTML.",
    "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
  },
  "metadata": {
    "version": 1
  }
}
{
  "name": "Haribo",
  "description": "Description of <strong>Haribo</strong> in HTML.",
  "localizedName": {
    "en": "Brand one",
    "de": "Marke einz"
  },
  "localizedDescription": {
    "en": "Description of <strong>Brand one</strong> in HTML.",
    "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
  },
  "image": "https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id",
  "cloudinaryUrl": "tenant/brands/media_Id",
  "metadata": {
    "createdAt": "2015-01-17T23:00:52.364Z",
    "modifiedAt": "2015-01-17T23:00:52.364Z",
    "version": 2
  },
  "id": "55421f3b6ecea7b1a3b73d26"
}

Deleting a brand

delete

Deletes a specified brand.


Required scopes

  • brand.brand_manage

Authorizations
Path parameters
brandIdstringRequired

Unique identifier of a brand.

Responses
204
The brand has been successfully deleted.
delete
DELETE /brands/{brandId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Partially updating a brand

patch

Partially updates a specified brand by replacing specificed fields from the request body.


Required scopes

  • brand.brand_manage

Authorizations
Path parameters
brandIdstringRequired

Unique identifier of a brand.

Header parameters
Content-LanguagestringOptional

Defines the language in which the localized fields are specified. If set to *, the request body may contain translations into all languages specified in the tenant configuration. The specified language need to be defined in the Configuration Serivce under project_lang key.

Note: If not specified, localized fields will be saved in the default language configured by the tenant in the Configuration Service.

Example: en
Body
namestringOptional

Brand name.

Example: Brand one
descriptionstringOptional

Brand description.

Example: Description of <strong>Haribo</strong> in HTML.
imagestringOptionalDeprecated

Link to the associated media file. This field is deprecated. Media assignment should be done through media-service.

Example: https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id
cloudinaryUrlstringOptionalDeprecated

Id of the associated media file. This field is deprecated. Media assignment should be done through media-service.

Example: {tenant}/brands/{media_Id}
Responses
200
The brand has been successfully updated.
application/json
patch
PATCH /brands/{brandId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 84

{
  "name": "Brand one",
  "description": "Description of <strong>Haribo</strong> in HTML."
}
{
  "name": "Haribo",
  "description": "Description of <strong>Haribo</strong> in HTML.",
  "localizedName": {
    "en": "Brand one",
    "de": "Marke einz"
  },
  "localizedDescription": {
    "en": "Description of <strong>Brand one</strong> in HTML.",
    "de": "Beschreibung der <strong>Marke einz</strong> in HTML."
  },
  "image": "https://res.cloudinary.com/saas-ag/image/upload/tenant/brands/media_Id",
  "cloudinaryUrl": "tenant/brands/media_Id",
  "metadata": {
    "createdAt": "2015-01-17T23:00:52.364Z",
    "modifiedAt": "2015-01-17T23:00:52.364Z",
    "version": 2
  },
  "id": "55421f3b6ecea7b1a3b73d26"
}

Was this helpful?