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 nameObligationDefinition/Value
criteriaOptionalNarrows 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.
rangeOptionalLimits 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 ObligationDescription/Value
adminsReturned if success = trueA 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.
countReturned if success = trueThe number of admins returned.
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 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": "domain_ad[email protected]",
      "type": "domain",
      "control": [
        "example.com"
      ]
    },
    {
      "user": "[email protected]",
      "type": "workgroup",
      "control": [
        "example.com/sales"
      ]
    } 
  ],
}