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 nameObligationDefinition/Value
criteriaOptionalNarrows 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
rangeOptionalRestricts 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 nameObligationDescription/Value
brandsReturned if success = trueAn 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.
countReturned if success = trueThe number of brands returned in the response.
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
successAlways returnedIndicates whether the request was successful or not. Allowed values are true and false.
total_countReturned if success = trueThe total number of brands that meet the criteria specified in the request.

Note: If range is specified in the request, this value may be larger than the value of count.

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
}