search_admins

The search_admins method retrieves a list of the admins in a specified company.

Syntax

{
    <credentials object> 
    "criteria": {
        "company": <company>,
        "type": [<one or more of company, domain, mail, workgroup], 
        "match": <wildcard pattern>
    }
    "range": {
        "first": <number>, 
        "limit": <number>
}

Request fields for search_admins

The following fields can be used in the search_admins method:

Field name

Obligation

Definition/Value

criteria

Optional

Narrows the results by restricting the search to the specified fields and their values.

Allowed values are:

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

  • match — Returns only those admins whose user names matches the specified pattern. You can use the following wildcards:

  • ? ― Match a single character

  • * ― Match a string of characters.

  • type — Returns only admins of the specified type. Allowed values are:company, domain, mail, and workgroup. If not specified, admins of all types are returned.

Note: The criteria values work together, so if both a type and match are specified, the response includes only admins of the specified type that also match the pattern.

range

Optional

Limits the range of admins to display. Allowed values are:

  • first — The 0-based index of the first admin to return; the default is the first result.

  • limit — The maximum number of results to return.

Response fields for search_admins

The following fields may be returned when the search_admins method is submitted:

Field name 

Obligation

Description/Value

admins

Returned if success = true

A list of the admins that meet the criteria and their attributes.
Allowed values are:

  • control — The area of responsibility that the admin controls. For company admins this displays the company name, for domain and mail admins it displays the domain name for workgroup admins it displays domain/workgroup.

  • type — The type of admin. Allowed values are: company, domain, mail, and workgroup.

  • user — The admin's user name.

count

Returned if success = true

The number of admins returned.

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 admins that match the search criteria. This value may be more than the number of results returned if a range was specified in the request.

Examples for search_admins

Request

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

Response

{
  "success": true,
  "count": 3,
  "total_count": 3
  "admins": [
    {
      "user": "[email protected]", 
      "type": "company",
      "control": [
        "Example Corp"
      ]
    }, 
    {
      "user": "[email protected]",
      "type": "domain",
      "control": [
        "example.com"
      ]
    },
    {
      "user": "[email protected]",
      "type": "workgroup",
      "control": [
        "example.com/sales"
      ]
    } 
  ],
}