search_brands

The search_brands method retrieves a list of brands in a company.

Syntax

{
    <credentials object>, 
    "criteria": {
      "company": <company>, 
      "match": <wildcard pattern>, 
      "deleted": true | false
    } 
    range:{
      "first": <number>,
      "Limit": <number> 
}

Request fields for search_brands

The following fields can be used in the search_brands method:

Field name

Obligation

Definition/Value

criteria

Optional

Narrows the search for brands.

Allowed values are:

  • company—The company in which to search for brands. If not specified, the requester's company is used.

  • deleted—Specify whether the brand has been deleted or not. Allowed values are true and false.

  • match—Specify a wildcard pattern to search for brand names. The ? wildcard matches a single character and the *wildcard matches a string of characters

range

Optional

Restricts the number of results that are returned. Allowed values are:

  • first—The 0-based index of the first result to return.

  • limit—The maximum number of results to return.

Response fields for search_brands

The following fields may be returned in response to the search_brands method:

Field name

Obligation

Description/Value

brands

Returned if success = true

An array that contains an alphabetical list of the brands that meet the specified criteria and indicates the brands usage.

Displays the following:

  • brand—The brand name.

  • counts—The number of domains and users assigned this brand. Includes the following values:

  • domain—The number of domains to which the brand is assigned.

  • total—The total number of domains and users to which the brand is assigned.

  • user—The number of users to which the brand is assigned.

count

Returned if success = true

The number of brands returned in the response.

error

Returned if success = false

A text string that explains the error.

error_number

Returned if success = false

A number that represents the error.

success

Always returned

Indicates whether the request was successful or not. Allowed values are true and false.

total_count

Returned if success = true

The total number of brands that meet the criteria specified in the request.

  • *Note: Ifrangeis specified in the request, this value may be larger than the value ofcount**.

Examples for search_brands

Example 1

Retrieves all brands in the requester's company.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdf1sh"
  }
}

Response

{
  "success": true,
  "brands": [
    {
      "brand": "Example Co Brand",
      "counts": {
        "domain": 0,
        "user": 0,
        "total": 0
			} 
		},
    {
      "brand": "Example Co Test Brand",
      "counts": {
        "domain": 0,
        "user": 0,
        "total": 0
			} 
		}
  ],
  "count": 2,
  "total_count": 2
}

Example 2

Retrieves all brands that contain "Test" in the brand name.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdf1sh"
  },
  "criteria": {
    "match": "*Test*"
  } 
}

Response

{
  "success": true,
  "brands": [
    {
      "brand": "Example Co Test Brand",
      "counts": {
        "domain": 0,
        "user": 0,
        "total": 0
			} 
		}
  ],
  "count": 1,
  "total_count": 1
}