{"_id":"56b794566c2a240d0094ae8a","version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":148,"githubsync":"","project":"569f9cf6650e1d1900f96b5b","category":{"_id":"56b25826147e900d00d6497a","project":"569f9cf6650e1d1900f96b5b","version":"569f9cf6650e1d1900f96b5e","pages":["56b2583a9621f20d00efb31c","56b25a3965ddf50d0076baa2","56b2738894ab060d0006743c","56b4d1cf5f1cf00d00cc46d7","56b4f4e2b1a8690d00a59369","56b4f6925f1cf00d00cc4704","56b4fa3d5997532100bc6bcc","56b50ba8eed075230097d71e","56b5123585a6922300d1c506","56b51e475997532100bc6c08","56b5220b7719bb1900143055","56b524cc3d5f130d00dad1b8","56b5265b168b5c1700c15996","56b774438fb4420d006a618b","56b78012eb783a0d007894f3","56b78292a6c10c0d00a2d65d","56b7863aeb783a0d007894f8","56b78f68a6c10c0d00a2d66b","56b794566c2a240d0094ae8a","56b7a85dd22adc0d0053f4c2","56b7ac118fb4420d006a61b7"],"__v":21,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-03T19:42:30.051Z","from_sync":false,"order":7,"slug":"user-methods","title":"User methods"},"user":"5582e90181672a3900bb4fc7","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-07T19:00:38.963Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":19,"body":"## Syntax \n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\t<credentials object>, \\n    \\\"criteria\\\": {\\n\\t\\t\\t\\t\\t\\\"domain\\\": <domain name>,\\n\\t\\t\\t\\t\\t\\\"workgroup\\\": <workgroup name>,\\n\\t\\t\\t\\t\\t\\\"type\\\": [<one or more of mailbox, filter, forward, or alias>]\\n\\t\\t\\t\\t\\t\\\"match\\\": <wildcard pattern>,\\n        \\t\\\"deleted\\\": TRUE | FALSE,\\n\\t\\t\\t\\t\\t\\\"status\\\": [<one or more of active, deleted, suspended, \\nsmtplimit, or quota>]\\n\\t\\t}\\n\\t\\t\\\"range\\\": {\\n\\t\\t\\t\\t\\\"first\\\": <number>,\\n\\t\\t\\t\\t\\\"limit\\\": <number> \\n    }\\n\\t\\t\\\"sort\\\": {\\n\\t\\t\\t\\tby: <createtime | delete_time | id | lastlogin | status | \\ntarget | type | user | workgroup>,\\n        direction: <ascending | descending>\\n    }\\n\\t\\t\\\"fields\\\": [<one or more of createtime, forward, lastlogin , \\nsmtplimit, status, or workgroup>]\\n }\\n\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"success\\\": true, \\n  \\\"count\\\": <number>,\\n\\t\\\"total_count\\\": <number>, \\n  \\\"users\\\": [\\n\\t  {\\n\\t\\t\\t\\\"user\\\": <user name>,\\n\\t\\t\\t\\\"workgroup\\\": <workgroup name>,\\n\\t\\t\\t\\\"type\\\": mailbox |filter | forward | alias, \\n      \\\"forward_recepient_count\\\": <number>, \\n      \\\"forward_recepient\\\": <email address>, \\n      \\\"alias_target\\\": <username>,\\n\\t\\t\\t\\\"id\\\":<string>,\\n\\t\\t\\t\\\"status\\\":<string>,\\n\\t\\t\\t\\\"createtime\\\":<epoch timestamp>, \\n      \\\"lastlogin\\\":<epoch timestamp>\\n\\t\\t}\\n\\t\\t<...> \\n  ]\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for search_users\"\n}\n[/block]\nThe following fields can be used in the **search_users** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"criteria\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"Narrows the results by restricting the search to the specified fields and their values.\\n\\n**Note**: You must specify the domain; all other criteria are optional.\\n\\nAllowed values are:\\n\\n  * **deleted** — Specifies whether to return only deleted user accounts. Allowed values are **true** and **false**.\\n\\n  * **domain** — Specifies the domain to search. This is required.\\n \\n  * **match** — Returns only those user accounts that match the specified pattern. You can use the following wildcards: \\n\\n   * **?** ― Match a single character\\n   * ***** ― Match multiple characters. \\n  \\n  * **status** — Returns only those user account with the specified status. If not specified, returns all statuses except **deleted**. Allowed values are: \\n\\n   * **active** — Mailbox is currently active.\\n   \\n   * **deleted** — Mailbox has been deleted.\\n   \\n   * **quota** — Mailbox is over quota and cannot receive any more mail.\\n   \\n   * **smtplimit** — Mailbox is at the smtp limit and user cannot send any more mail.\\n   \\n   * **aup** — Mailbox has been suspended and user cannot send or receive mail.\\n\\n  * **type** — Returns only user accounts of the specified type. Allowed values are: \\n\\n   * **alias** — Alias mailboxes\\n   \\n   *  **filter** — Filter-only mailboxes\\n   \\n   * **forward** — Forward-only mailboxes \\n   \\n   * **mailbox** — Regular mailboxes\\n\\n  * **workgroup** — Returns only user accounts in the specified workgroup.\\n\\nThe criteria fields work together to restrict the results, for example, if both **workgroup** and **match** are specified, the method returns only those users that are in that workgroup and match the pattern.\",\n    \"1-0\": \"fields\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"Additional fields to return. Allowed values are: **createtime, forward, lastlogin, status, type**, and **workgroup**.\\n\\nIf not specified, defaults to **workgroup** and **status**.\",\n    \"2-0\": \"range\",\n    \"2-1\": \"Optional\",\n    \"2-2\": \"Limits the range of user accounts to display. Allowed values are:\\n\\n  * **first** — Specify the first user to return; the default is the first result.\\n  \\n  * **limit** — Specify the maximum number of users to return.\",\n    \"3-0\": \"sort\",\n    \"3-1\": \"Optional\",\n    \"3-2\": \"Determines the way in which to sort and display results. \\n\\nAllowed values are:\\n\\n  * **by** — Specify the attribute to use to sort results. Allowed values are: \\n\\n   * **createtime** — The date when the account was create, in UNIX Epoch time.\\n   \\n   * **delete_time** — The time the user account was deleted. Can be used only if **criteria = deleted**.\\n   \\n   * **id** — The identification number of the soft deleted account.\\n   \\n   * **lastlogin** — The last time (displayed in UNIX Epoch time) that the user successfully logged in via pop3, imap4, webmail, or smtprelay.\\n   \\n   * **status** — The status of the account.\\n   \\n   * **target** — The **alias** target or **forward** target of the user.\\n\\n   * **type** — The type of user: **alias, filter, forward**, or **mailbox**.\\n   \\n   * **user** — The user name (this is the\\ndefault).\\n\\n   * **workgroup** — The user's workgroup. \\n\\n  * **direction** — Specify the sort order. Allowed values are **ascending** (default) or **descending**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for search_users\"\n}\n[/block]\nThe following fields may be returned when the **search_users** method is submitted:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"count\",\n    \"0-1\": \"Returned if **success = true**\",\n    \"0-2\": \"The number of users returned.\",\n    \"1-0\": \"error\",\n    \"1-1\": \"Returned if **success = false**\",\n    \"1-2\": \"A text string that explains the error.\",\n    \"2-0\": \"error_number\",\n    \"2-1\": \"Returned if **success = false**\",\n    \"2-2\": \"A number that represents the error.\",\n    \"3-0\": \"success\",\n    \"3-1\": \"Always returned\",\n    \"3-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\",\n    \"4-0\": \"total_count\",\n    \"4-1\": \"Returned if **success = true**\",\n    \"4-2\": \"The total number of users that match the search criteria. This value may be more than the number of results returned if a **range** was specified in the request.\",\n    \"5-0\": \"users\",\n    \"5-1\": \"Returned if **success = true**\",\n    \"5-2\": \"A list of the mailboxes that meet the criteria, and, optionally, their attributes.\\n\\nAllowed values are:\\n\\n  * **alias_target** — The user for which this account is an alias. Returned only if the account is an alias.\\n  \\n  * **createtime** — The date when the account was create, in UNIX Epoch time. Only displayed if specified in the fields part of the request.\\n  \\n  * **forward_recipient** —   Returned only if the mailbox forwards to one or more addresses. If the mailbox forwards to only one address, that address is displayed; otherwise, the returned value is null.\\n  \\n  * **forward_recipient_count**    — Returned only if the mailbox forwards to one or more addresses. Specifies the number of addresses to which this account forwards.\\n  \\n  * **id** — The identification number of the account. Returned only if deleted = true.\\n  \\n  * **lastlogin** — The last time (displayed in UNIX Epoch time) that the user successfully logged in via pop3, imap4, webmail, or smtprelay. Not returned for aliases. Only present if specified in **fields** part of request. \\n\\n**Note**: The lastlogin timestamp may be up to 48 hours out of date.\\n\\n  * **status** — The status of the account. May be one of the following: \\n\\n   * **active** — mailbox is currently active\\n   \\n   * **deleted** — mailbox has been deleted\\n   \\n   * **quota** — mailbox is over quota and cannot receive any more mail.\\n   \\n   * **smtplimit** — mailbox is at the smtp limit and user cannot send any more mail.\\n   \\n   * **suspended**— mailbox has been suspended and user cannot send or receive mail.\\n\\n  * **type** — The type of account. May be one of the following:\\n  \\n   * **alias** — Alias mailbox\\n   \\n   * **filter** — Filter-only mailbox\\n   \\n   * **forward** — Forward-only mailbox\\n   \\n   * **mailbox** — Regular mailbox\\n\\n  * **user** — The user name for the account. \\n  \\n  * **workgroup** — The workgroup to which the user account belongs. Returned only if the user is not an alias.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for search_users\"\n}\n[/block]\n## Example 1\n\nSearches for all users in the domain example.com.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"domain_admin:::at:::example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\"\\n  } \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n\\t\\t{\\n\\t\\t\\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"domain_admin@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n  \\t\\t\\\"type\\\": \\\"mailbox\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"james_user@example.com\\\", \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"forward_recipient\\\": \\\"janet.user@bigmail.xom\\\", \\n      \\\"forward_recipient_count\\\": 1,\\n\\t\\t\\t\\\"user\\\": \\\"jane_user@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"forward\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n\\t\\t\\t\\\"user\\\": \\\"jeff@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n    {\\n    \\t\\\"user\\\": \\\"jennifer_user@example.com\\\", \\n      \\\"alias_target\\\": \\\"jenny@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"alias\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n\\t\\t\\t\\\"user\\\": \\\"jenny@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n      \\\"forward_recipient\\\": null,\\n      \\\"forward_recipient_count\\\": 2,\\n      \\\"user\\\": \\\"jim@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"forward\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"joe_user@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"june_user@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"sales\\\",\\n\\t\\t\\t\\\"user\\\": \\\"mrmanager@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    } \\n  ],\\n  \\\"count\\\": 10,\\n  \\\"total_count\\\": 10\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 2\n\nRetrieves all users in the domain example.com, sorted by workgroup, in reverse alphabetical order .\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"domain_admin@example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\"\\n  }, \\n  \\\"sort\\\": {\\n    \\\"by\\\": \\\"workgroup\\\",\\n    \\\"direction\\\": \\\"descending\\\"\\n  }\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n\\t\\t{\\n\\t\\t\\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"domain_admin@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n\\t\\t}, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"james_user@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"forward_recipient\\\": \\\"janet.user@bigmail.xom\\\", \\n      \\\"forward_recipient_count\\\": 1,\\n      \\\"user\\\": \\\"jane_user@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"forward\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n      \\\"user\\\": \\\"joe_user@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"mailbox\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n      \\\"user\\\": \\\"june_user_restored@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"mailbox\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"sales\\\",\\n\\t\\t\\t\\\"user\\\": \\\"mrmanager@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"mailbox\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n      \\\"user\\\": \\\"jeff@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"mailbox\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n      \\\"user\\\": \\\"jenny@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"mailbox\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n      \\\"forward_recipient\\\": null,\\n      \\\"forward_recipient_count\\\": 2,\\n      \\\"user\\\": \\\"jim@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"forward\\\"\\n    }, \\n    {\\n    \\t\\\"user\\\": \\\"jennifer_user@example.com\\\", \\n      \\\"alias_target\\\": \\\"jenny@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"alias\\\"\\n    } \\n  ],\\n  \\\"count\\\": 10,\\n  \\\"total_count\\\": 10\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 3\n\nRetrieves all the forward and alias users in the domain example.com.\n\n**Request**\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"}\\n  \\\"credentials\\\": {\\n\\t\\t\\\"user\\\": \\\"domain_admin@example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\",\\n    \\\"type\\\": [\\n\\t\\t\\t\\\"forward\\\",\\n\\t\\t\\t\\\"alias\\\" \\n    ]\\n  } \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n\\t\\t{\\n\\t\\t\\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"\\\"forward_recipient\\\": \\\"janet.user@bigmail.xom\\\", \\n      \\\"\\\"forward_recipient_count\\\": 1,\\n\\t\\t\\t\\\"\\\"user\\\": \\\"jane_user@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"\\\"type\\\": \\\"forward\\\"\\n    }, \\n    {\\n    \\t\\\"user\\\": \\\"jennifer_user@example.com\\\", \\n      \\\"alias_target\\\": \\\"jenny@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"alias\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n    \\t\\\"forward_recipient\\\": null,\\n\\t\\t\\t\\\"forward_recipient_count\\\": 2,\\n\\t\\t\\t\\\"user\\\": \\\"jim@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"forward\\\"\\n    }\\n  ],\\n  \\\"count\\\": 3,\\n  \\\"total_count\\\": 3\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 4\n\nRetrieves the first three users in the domain example.com.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"domain_admin@example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\"\\n  }, \\n  \\\"range\\\": {\\n    \\\"first\\\": 0,\\n    \\\"limit\\\": 3 \\n  }\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n  \\t{\\n\\t\\t\\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"domain_admin@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n\\t\\t}, \\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n\\t\\t\\t\\\"user\\\": \\\"james_user@example.com\\\", \\n      \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n      \\\"forward_recipient\\\": \\\"janet.user@bigmail.com\\\", \\n      \\\"forward_recipient_count\\\": 1,\\n\\t\\t\\t\\\"user\\\": \\\"jane_user@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"forward\\\"\\n    }\\n\\t],\\n  \\\"count\\\": 3,\\n\\t\\\"total_count\\\": 10\\n}\\n\\n\\n\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 5\n\nRetrieves the second three users in the domain example.com.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"domain_admin@example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\"\\n  }, \\n  \\\"range\\\": {\\n    \\\"first\\\": 3,\\n    \\\"limit\\\": 3 \\n  }\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n    {\\n      \\\"workgroup\\\": \\\"interns\\\",\\n      \\\"user\\\": \\\"jeff@example.com\\\",\\n      \\\"status\\\": \\\"active\\\",\\n      \\\"type\\\": \\\"mailbox\\\"\\n    },\\n\\t\\t{\\n\\t\\t\\t\\\"user\\\": \\\"jennifer_user@example.com\\\", \\n      \\\"alias_target\\\": \\\"jenny@example.com\\\", \\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"alias\\\"\\n\\t\\t}, \\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n\\t\\t\\t\\\"user\\\": \\\"jenny@example.com\\\",\\n\\t\\t\\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"type\\\": \\\"mailbox\\\"\\n    } \\n  ],\\n  \\\"count\\\": 3,\\n  \\\"total_count\\\": 10\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 6\n\nRetrieves all deleted users in the domain example.com.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"domain_admin@example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\",\\n    \\\"deleted\\\": true\\n  } \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n    {\\n      \\\"workgroup\\\": \\\"staff\\\",\\n      \\\"user\\\": \\\"jack_user@example.com\\\",\\n      \\\"type\\\": \\\"mailbox\\\",\\n      \\\"status\\\": \\\"deleted\\\",\\n      \\\"id\\\": \\\"1321905217\\\"\\n} ],\\n\\\"count\\\": 1,\\n  \\\"total_count\\\": 1\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 7\n\n**Request**\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"domain_admin@example.com\\\",\\n    \\\"password\\\": \\\"pencil75\\\"\\n  },\\n  \\\"criteria\\\": {\\n    \\\"domain\\\": \\\"example.com\\\"\\n  },\\n  \\\"fields\\\": [\\\"status\\\", \\\"lastlogin\\\", \\\"createtime\\\"] \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"users\\\": [\\n    {\\n      \\\"status\\\": \\\"quota\\\",\\n      \\\"user\\\": \\\"tucker@example.com\\\",\\n      \\\"lastlogin\\\": \\\"\\\",\\n      \\\"createtime\\\": \\\"1340021200\\\"\\n\\t\\t}, \\n\\t\\t{\\n    \\t\\\"status\\\": \\\"smtplimit\\\",\\n      \\\"user\\\": \\\"robson@example.com\\\",\\n      \\\"lastlogin\\\": \\\"\\\",\\n      \\\"createtime\\\": \\\"1340021200\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"status\\\": \\\"suspended\\\",\\n      \\\"user\\\": \\\"martin@example.com\\\",\\n      \\\"lastlogin\\\": \\\"\\\",\\n      \\\"createtime\\\": \\\"1340021200\\\"\\n    }, \\n\\t\\t{\\n    \\t\\\"status\\\": \\\"active\\\",\\n\\t\\t\\t\\\"user\\\": \\\"roscoe@example.com\\\",\\n\\t\\t\\t\\\"lastlogin\\\": \\\"1350000000\\\",\\n\\t\\t\\t\\\"createtime\\\": \\\"1330971427\\\"\\n    } \\n  ],\\n  \\t\\t\\\"count\\\": 4,\\n      \\\"total_count\\\": 4,\\n      \\\"audit\\\": \\\"pin28_514b678124\\\"\\n}\\n\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **search_users** method searches for users in a specified domain. You must specify the domain to search, and you can submit other criteria to narrow your search. Each additional criteria field that you specify further narrows the search, and wildcard characters are allowed.","slug":"search_users","type":"basic","title":"search_users"}

search_users

The **search_users** method searches for users in a specified domain. You must specify the domain to search, and you can submit other criteria to narrow your search. Each additional criteria field that you specify further narrows the search, and wildcard characters are allowed.

## Syntax **Request** [block:code] { "codes": [ { "code": "{\n\t\t<credentials object>, \n \"criteria\": {\n\t\t\t\t\t\"domain\": <domain name>,\n\t\t\t\t\t\"workgroup\": <workgroup name>,\n\t\t\t\t\t\"type\": [<one or more of mailbox, filter, forward, or alias>]\n\t\t\t\t\t\"match\": <wildcard pattern>,\n \t\"deleted\": TRUE | FALSE,\n\t\t\t\t\t\"status\": [<one or more of active, deleted, suspended, \nsmtplimit, or quota>]\n\t\t}\n\t\t\"range\": {\n\t\t\t\t\"first\": <number>,\n\t\t\t\t\"limit\": <number> \n }\n\t\t\"sort\": {\n\t\t\t\tby: <createtime | delete_time | id | lastlogin | status | \ntarget | type | user | workgroup>,\n direction: <ascending | descending>\n }\n\t\t\"fields\": [<one or more of createtime, forward, lastlogin , \nsmtplimit, status, or workgroup>]\n }\n", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n\t\"success\": true, \n \"count\": <number>,\n\t\"total_count\": <number>, \n \"users\": [\n\t {\n\t\t\t\"user\": <user name>,\n\t\t\t\"workgroup\": <workgroup name>,\n\t\t\t\"type\": mailbox |filter | forward | alias, \n \"forward_recepient_count\": <number>, \n \"forward_recepient\": <email address>, \n \"alias_target\": <username>,\n\t\t\t\"id\":<string>,\n\t\t\t\"status\":<string>,\n\t\t\t\"createtime\":<epoch timestamp>, \n \"lastlogin\":<epoch timestamp>\n\t\t}\n\t\t<...> \n ]\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for search_users" } [/block] The following fields can be used in the **search_users** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "criteria", "0-1": "Required", "0-2": "Narrows the results by restricting the search to the specified fields and their values.\n\n**Note**: You must specify the domain; all other criteria are optional.\n\nAllowed values are:\n\n * **deleted** — Specifies whether to return only deleted user accounts. Allowed values are **true** and **false**.\n\n * **domain** — Specifies the domain to search. This is required.\n \n * **match** — Returns only those user accounts that match the specified pattern. You can use the following wildcards: \n\n * **?** ― Match a single character\n * ***** ― Match multiple characters. \n \n * **status** — Returns only those user account with the specified status. If not specified, returns all statuses except **deleted**. Allowed values are: \n\n * **active** — Mailbox is currently active.\n \n * **deleted** — Mailbox has been deleted.\n \n * **quota** — Mailbox is over quota and cannot receive any more mail.\n \n * **smtplimit** — Mailbox is at the smtp limit and user cannot send any more mail.\n \n * **aup** — Mailbox has been suspended and user cannot send or receive mail.\n\n * **type** — Returns only user accounts of the specified type. Allowed values are: \n\n * **alias** — Alias mailboxes\n \n * **filter** — Filter-only mailboxes\n \n * **forward** — Forward-only mailboxes \n \n * **mailbox** — Regular mailboxes\n\n * **workgroup** — Returns only user accounts in the specified workgroup.\n\nThe criteria fields work together to restrict the results, for example, if both **workgroup** and **match** are specified, the method returns only those users that are in that workgroup and match the pattern.", "1-0": "fields", "1-1": "Optional", "1-2": "Additional fields to return. Allowed values are: **createtime, forward, lastlogin, status, type**, and **workgroup**.\n\nIf not specified, defaults to **workgroup** and **status**.", "2-0": "range", "2-1": "Optional", "2-2": "Limits the range of user accounts to display. Allowed values are:\n\n * **first** — Specify the first user to return; the default is the first result.\n \n * **limit** — Specify the maximum number of users to return.", "3-0": "sort", "3-1": "Optional", "3-2": "Determines the way in which to sort and display results. \n\nAllowed values are:\n\n * **by** — Specify the attribute to use to sort results. Allowed values are: \n\n * **createtime** — The date when the account was create, in UNIX Epoch time.\n \n * **delete_time** — The time the user account was deleted. Can be used only if **criteria = deleted**.\n \n * **id** — The identification number of the soft deleted account.\n \n * **lastlogin** — The last time (displayed in UNIX Epoch time) that the user successfully logged in via pop3, imap4, webmail, or smtprelay.\n \n * **status** — The status of the account.\n \n * **target** — The **alias** target or **forward** target of the user.\n\n * **type** — The type of user: **alias, filter, forward**, or **mailbox**.\n \n * **user** — The user name (this is the\ndefault).\n\n * **workgroup** — The user's workgroup. \n\n * **direction** — Specify the sort order. Allowed values are **ascending** (default) or **descending**." }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for search_users" } [/block] The following fields may be returned when the **search_users** method is submitted: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "count", "0-1": "Returned if **success = true**", "0-2": "The number of users returned.", "1-0": "error", "1-1": "Returned if **success = false**", "1-2": "A text string that explains the error.", "2-0": "error_number", "2-1": "Returned if **success = false**", "2-2": "A number that represents the error.", "3-0": "success", "3-1": "Always returned", "3-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**.", "4-0": "total_count", "4-1": "Returned if **success = true**", "4-2": "The total number of users that match the search criteria. This value may be more than the number of results returned if a **range** was specified in the request.", "5-0": "users", "5-1": "Returned if **success = true**", "5-2": "A list of the mailboxes that meet the criteria, and, optionally, their attributes.\n\nAllowed values are:\n\n * **alias_target** — The user for which this account is an alias. Returned only if the account is an alias.\n \n * **createtime** — The date when the account was create, in UNIX Epoch time. Only displayed if specified in the fields part of the request.\n \n * **forward_recipient** — Returned only if the mailbox forwards to one or more addresses. If the mailbox forwards to only one address, that address is displayed; otherwise, the returned value is null.\n \n * **forward_recipient_count** — Returned only if the mailbox forwards to one or more addresses. Specifies the number of addresses to which this account forwards.\n \n * **id** — The identification number of the account. Returned only if deleted = true.\n \n * **lastlogin** — The last time (displayed in UNIX Epoch time) that the user successfully logged in via pop3, imap4, webmail, or smtprelay. Not returned for aliases. Only present if specified in **fields** part of request. \n\n**Note**: The lastlogin timestamp may be up to 48 hours out of date.\n\n * **status** — The status of the account. May be one of the following: \n\n * **active** — mailbox is currently active\n \n * **deleted** — mailbox has been deleted\n \n * **quota** — mailbox is over quota and cannot receive any more mail.\n \n * **smtplimit** — mailbox is at the smtp limit and user cannot send any more mail.\n \n * **suspended**— mailbox has been suspended and user cannot send or receive mail.\n\n * **type** — The type of account. May be one of the following:\n \n * **alias** — Alias mailbox\n \n * **filter** — Filter-only mailbox\n \n * **forward** — Forward-only mailbox\n \n * **mailbox** — Regular mailbox\n\n * **user** — The user name for the account. \n \n * **workgroup** — The workgroup to which the user account belongs. Returned only if the user is not an alias." }, "cols": 3, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Examples for search_users" } [/block] ## Example 1 Searches for all users in the domain example.com. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\"\n } \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n\t\t{\n\t\t\t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"domain_admin@example.com\",\n\t\t\t\"status\": \"active\",\n \t\t\"type\": \"mailbox\"\n\t\t},\n\t\t{\n\t\t\t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"james_user@example.com\", \"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n {\n \t\"workgroup\": \"staff\",\n\t\t\t\"forward_recipient\": \"janet.user@bigmail.xom\", \n \"forward_recipient_count\": 1,\n\t\t\t\"user\": \"jane_user@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"forward\"\n }, \n {\n \t\"workgroup\": \"interns\",\n\t\t\t\"user\": \"jeff@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n {\n \t\"user\": \"jennifer_user@example.com\", \n \"alias_target\": \"jenny@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"alias\"\n }, \n {\n \t\"workgroup\": \"interns\",\n\t\t\t\"user\": \"jenny@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n {\n \t\"workgroup\": \"interns\",\n \"forward_recipient\": null,\n \"forward_recipient_count\": 2,\n \"user\": \"jim@example.com\",\n \"status\": \"active\",\n \"type\": \"forward\"\n }, \n {\n \t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"joe_user@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n {\n \t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"june_user@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n {\n \t\"workgroup\": \"sales\",\n\t\t\t\"user\": \"mrmanager@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n } \n ],\n \"count\": 10,\n \"total_count\": 10\n}", "language": "perl", "name": " " } ] } [/block] ## Example 2 Retrieves all users in the domain example.com, sorted by workgroup, in reverse alphabetical order . **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\"\n }, \n \"sort\": {\n \"by\": \"workgroup\",\n \"direction\": \"descending\"\n }\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n\t\t{\n\t\t\t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"domain_admin@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n\t\t}, \n\t\t{\n \t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"james_user@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n\t\t{\n \t\"workgroup\": \"staff\",\n\t\t\t\"forward_recipient\": \"janet.user@bigmail.xom\", \n \"forward_recipient_count\": 1,\n \"user\": \"jane_user@example.com\",\n \"status\": \"active\",\n \"type\": \"forward\"\n }, \n\t\t{\n \t\"workgroup\": \"staff\",\n \"user\": \"joe_user@example.com\",\n \"status\": \"active\",\n \"type\": \"mailbox\"\n }, \n\t\t{\n \t\"workgroup\": \"staff\",\n \"user\": \"june_user_restored@example.com\", \n \"status\": \"active\",\n \"type\": \"mailbox\"\n }, \n\t\t{\n \t\"workgroup\": \"sales\",\n\t\t\t\"user\": \"mrmanager@example.com\",\n\t\t\t\"status\": \"active\",\n \"type\": \"mailbox\"\n }, \n\t\t{\n \t\"workgroup\": \"interns\",\n \"user\": \"jeff@example.com\",\n \"status\": \"active\",\n \"type\": \"mailbox\"\n }, \n\t\t{\n \t\"workgroup\": \"interns\",\n \"user\": \"jenny@example.com\",\n \"status\": \"active\",\n \"type\": \"mailbox\"\n }, \n\t\t{\n \t\"workgroup\": \"interns\",\n \"forward_recipient\": null,\n \"forward_recipient_count\": 2,\n \"user\": \"jim@example.com\",\n \"status\": \"active\",\n \"type\": \"forward\"\n }, \n {\n \t\"user\": \"jennifer_user@example.com\", \n \"alias_target\": \"jenny@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"alias\"\n } \n ],\n \"count\": 10,\n \"total_count\": 10\n}", "language": "perl", "name": " " } ] } [/block] ## Example 3 Retrieves all the forward and alias users in the domain example.com. **Request** [block:code] { "codes": [ { "code": "}\n \"credentials\": {\n\t\t\"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\",\n \"type\": [\n\t\t\t\"forward\",\n\t\t\t\"alias\" \n ]\n } \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n\t\t{\n\t\t\t\"workgroup\": \"staff\",\n\t\t\t\"\"forward_recipient\": \"janet.user@bigmail.xom\", \n \"\"forward_recipient_count\": 1,\n\t\t\t\"\"user\": \"jane_user@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"\"type\": \"forward\"\n }, \n {\n \t\"user\": \"jennifer_user@example.com\", \n \"alias_target\": \"jenny@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"alias\"\n }, \n {\n \t\"workgroup\": \"interns\",\n \t\"forward_recipient\": null,\n\t\t\t\"forward_recipient_count\": 2,\n\t\t\t\"user\": \"jim@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"forward\"\n }\n ],\n \"count\": 3,\n \"total_count\": 3\n}", "language": "perl", "name": " " } ] } [/block] ## Example 4 Retrieves the first three users in the domain example.com. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\"\n }, \n \"range\": {\n \"first\": 0,\n \"limit\": 3 \n }\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n \t{\n\t\t\t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"domain_admin@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n\t\t}, \n {\n \t\"workgroup\": \"staff\",\n\t\t\t\"user\": \"james_user@example.com\", \n \"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n }, \n {\n \t\"workgroup\": \"staff\",\n \"forward_recipient\": \"janet.user@bigmail.com\", \n \"forward_recipient_count\": 1,\n\t\t\t\"user\": \"jane_user@example.com\",\n\t\t\t\"status\": \"active\",\n \"type\": \"forward\"\n }\n\t],\n \"count\": 3,\n\t\"total_count\": 10\n}\n\n\n", "language": "perl", "name": " " } ] } [/block] ## Example 5 Retrieves the second three users in the domain example.com. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\"\n }, \n \"range\": {\n \"first\": 3,\n \"limit\": 3 \n }\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n {\n \"workgroup\": \"interns\",\n \"user\": \"jeff@example.com\",\n \"status\": \"active\",\n \"type\": \"mailbox\"\n },\n\t\t{\n\t\t\t\"user\": \"jennifer_user@example.com\", \n \"alias_target\": \"jenny@example.com\", \"status\": \"active\",\n\t\t\t\"type\": \"alias\"\n\t\t}, \n\t\t{\n \t\"workgroup\": \"interns\",\n\t\t\t\"user\": \"jenny@example.com\",\n\t\t\t\"status\": \"active\",\n\t\t\t\"type\": \"mailbox\"\n } \n ],\n \"count\": 3,\n \"total_count\": 10\n}", "language": "perl", "name": " " } ] } [/block] ## Example 6 Retrieves all deleted users in the domain example.com. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\",\n \"deleted\": true\n } \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n {\n \"workgroup\": \"staff\",\n \"user\": \"jack_user@example.com\",\n \"type\": \"mailbox\",\n \"status\": \"deleted\",\n \"id\": \"1321905217\"\n} ],\n\"count\": 1,\n \"total_count\": 1\n}", "language": "perl", "name": " " } ] } [/block] ## Example 7 **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\"\n },\n \"fields\": [\"status\", \"lastlogin\", \"createtime\"] \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"users\": [\n {\n \"status\": \"quota\",\n \"user\": \"tucker@example.com\",\n \"lastlogin\": \"\",\n \"createtime\": \"1340021200\"\n\t\t}, \n\t\t{\n \t\"status\": \"smtplimit\",\n \"user\": \"robson@example.com\",\n \"lastlogin\": \"\",\n \"createtime\": \"1340021200\"\n }, \n\t\t{\n \t\"status\": \"suspended\",\n \"user\": \"martin@example.com\",\n \"lastlogin\": \"\",\n \"createtime\": \"1340021200\"\n }, \n\t\t{\n \t\"status\": \"active\",\n\t\t\t\"user\": \"roscoe@example.com\",\n\t\t\t\"lastlogin\": \"1350000000\",\n\t\t\t\"createtime\": \"1330971427\"\n } \n ],\n \t\t\"count\": 4,\n \"total_count\": 4,\n \"audit\": \"pin28_514b678124\"\n}\n", "language": "perl", "name": " " } ] } [/block]