{"_id":"56b2486e8e24c10d005f68d8","project":"569f9cf6650e1d1900f96b5b","user":"5582e90181672a3900bb4fc7","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":37,"githubsync":"","category":{"_id":"56b2432e9621f20d00efb2bd","pages":["56b24348f48f270d00e0df01","56b2438be969500d00ac0e72","56b2464e94ab060d000673f9","56b2486e8e24c10d005f68d8"],"version":"569f9cf6650e1d1900f96b5e","__v":4,"project":"569f9cf6650e1d1900f96b5b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-03T18:13:02.463Z","from_sync":false,"order":6,"slug":"workgroup-methods","title":"Workgroup methods"},"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-03T18:35:26.050Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  <credentials object>, \\n  \\\"criteria\\\": {\\n    \\\"domain\\\": <domain name>,\\n    \\\"match\\\": <wildcard pattern> \\n  }\\n  \\\"range\\\":{\\n     \\\"first\\\": <number>, \\n     \\\"limit\\\": <number> \\n     \\\"sort\\\": {\\n        \\\"by\\\": workgroup | users\\n        \\\"direction\\\": ascending | descending\\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_workgroups\"\n}\n[/block]\nThe following fields can be used in the **search_workgroups** 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. \\n\\nAllowed values are:\\n\\n  * **domain** — Specifies the domain to search. This is required.\\n\\n  * **match** — Returns only those workgroups that match the specified pattern. You can use the following wildcards: \\n   *   **?** ― Match a single character\\n   * ***** ― Match multiple characters.\",\n    \"1-0\": \"range\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"Limits the results to a subset of those selected by the **criteria** values.\\n\\nAllowed values are:\\n\\n  * **first** — Specify the first workgroup to return; the default is the first result.\\n\\n  * **limit** — Specify the maximum number of results to return.\",\n    \"2-0\": \"sort\",\n    \"2-1\": \"Optional\",\n    \"2-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   * **user** — The number of users in the workgroup.\\n   \\n   * **workgroup** — The workgroup name (this is the default).\\n\\n  * **direction** — Specify the sort order. Allowed values are **ascending** (this is the default) or **descending**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for search_workgroups\"\n}\n[/block]\nThe following fields may be returned in response to the **search_workgroups** method:\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 workgroups 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 workgroups 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\": \"workgroups\",\n    \"5-1\": \"Returned if **success = true**\",\n    \"5-2\": \"A list of the workgroups that meet the criteria and their attributes. \\n\\nIncludes the following:\\n\\n  * **counts** — The number of each type of mailbox in the workgroup.\\n  \\n   * **filter** — The number of filter only mailboxes (**delivery_filter** attribute set to **true**).\\n   \\n   * **forward** — The number of forward only mailboxes (**delivery_forward** attribute set to true and **delivery_local** set to **false**).\\n   \\n   * **mailbox** — The number of mailboxes (**delivery_local** attribute set to **true**).\\n   \\n   * **total** — The total number of users in the workgroup.\\n\\n  * **workgroup** — The workgroup name.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for search_workgroups\"\n}\n[/block]\n## Example 1\n\nRetrieves all workgroups 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  \\\"count\\\": 7,\\n  \\\"total_count\\\": 7,\\n  \\\"workgroups\\\": [\\n    {\\n      \\\"workgroup\\\": \\\"contract\\\",\\n      \\\"counts\\\": {\\n      \\t\\\"filter\\\": 0,\\n\\t\\t\\t\\t\\\"forward\\\": 0,\\n\\t\\t\\t\\t\\\"mailbox\\\": 0,\\n\\t\\t\\t\\t\\\"total\\\": 0\\n      } \\n    },\\n\\t\\t{\\n    \\t\\\"workgroup\\\": \\\"interns\\\",\\n  \\t\\t\\\"counts\\\": {\\n    \\t\\t\\\"filter\\\": 0,\\n    \\t\\t\\\"forward\\\": 1,\\n    \\t\\t\\\"mailbox\\\": 2,\\n    \\t\\t\\\"total\\\": 3\\n    }, \\n    {\\n    \\t\\\"workgroup\\\": \\\"sales\\\",\\n\\t\\t\\t\\t\\\"counts\\\": {\\n  \\t\\t\\t\\\"filter\\\": 0,\\n  \\t\\t\\t\\\"forward\\\": 0,\\n  \\t\\t\\t\\\"mailbox\\\": 1,\\n  \\t\\t\\t\\\"total\\\": 1\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"sales_europe\\\",\\n  \\t\\t\\\"counts\\\": {\\n    \\t\\t\\\"filter\\\": 0,\\n    \\t\\t\\\"forward\\\": 0,\\n    \\t\\t\\\"mailbox\\\": 0,\\n    \\t\\t\\\"total\\\": 0\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n  \\t\\t\\\"counts\\\": {\\n      \\t\\\"filter\\\": 0,\\n        \\\"forward\\\": 1,\\n        \\\"mailbox\\\": 4,\\n        \\\"total\\\": 5\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"stock_holders\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 0,\\n        \\\"total\\\": 0\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"sysadmins\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 0,\\n        \\\"total\\\": 0\\n      }\\n    }\\n  ],\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 2\n\nRetrieves all workgroups that start with 's'.\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    \\\"match\\\": \\\"s*\\\"\\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  \\\"count\\\": 5,\\n  \\\"total_count\\\": 5,\\n  \\\"workgroups\\\": [\\n    {\\n    \\t\\\"workgroup\\\": \\\"sales\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 1,\\n        \\\"total\\\": 1\\n      }\\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"sales_europe\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 0,\\n        \\\"total\\\": 0\\n      }\\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 1,\\n        \\\"mailbox\\\": 4,\\n        \\\"total\\\": 5\\n      }\\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"stock_holders\\\",\\n\\t\\t\\t\\\"counts\\\": {\\n  \\t\\t\\t\\\"filter\\\": 0,\\n  \\t\\t\\t\\\"forward\\\": 0,\\n  \\t\\t\\t\\\"mailbox\\\": 0,\\n  \\t\\t\\t\\\"total\\\": 0\\n      }\\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"sysadmins\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 0,\\n        \\\"total\\\": 0\\n      } \\n    }\\n\\t], \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 3\n\nRetrieves the first three workgroups that start with 's' in the domain example.com.\n\n**Request** \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    \\\"match\\\": \\\"s*\\\"\\n  },\\n  \\\"range\\\": {\\n    \\\"first\\\": 0,\\n    \\\"limit\\\": 3\\n\\t} \\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  \\\"count\\\": 3,\\n  \\\"total_count\\\": 5,\\n  \\\"workgroups\\\": [\\n    {\\n      \\\"workgroup\\\": \\\"sales\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 1,\\n        \\\"total\\\": 1\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"sales_europe\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 0,\\n        \\\"total\\\": 0\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"staff\\\",\\n      \\\"counts\\\": {\\n\\t\\t\\t\\t\\\"filter\\\": 0,\\n        \\\"forward\\\": 1,\\n        \\\"mailbox\\\": 4,\\n        \\\"total\\\": 5\\n      } \\n    }\\n  ], \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 4\n\nRetrieves the next three workgroups that start with 's' in the domain example.com.\n\n**Request** \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    \\\"match\\\": \\\"s*\\\"\\n\\t}, \\n\\t\\\"range\\\": {\\n\\t\\t\\\"first\\\": 3,\\n\\t\\t\\\"limit\\\": 3 \\n \\t}\\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  \\\"count\\\": 2,\\n  \\\"total_count\\\": 5,\\n  \\\"workgroups\\\": [\\n    {\\n      \\\"workgroup\\\": \\\"stock_holders\\\",\\n      \\t\\\"counts\\\": {\\n      \\t\\\"filter\\\": 0,\\n\\t\\t\\t\\t\\\"forward\\\": 0,\\n\\t\\t\\t\\t\\\"mailbox\\\": 0,\\n\\t\\t\\t\\t\\\"total\\\": 0\\n      } \\n    },\\n    {\\n    \\t\\\"workgroup\\\": \\\"sysadmins\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"mailbox\\\": 0,\\n        \\\"total\\\": 0\\n\\t\\t\\t} \\n\\t\\t}\\n\\t], \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 5\n\nRetrieves the first three workgroups that start with 's' in the domain example.com, sorting by number of users in the workgroup, in descending order.\n\n**Request**\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    \\\"match\\\": \\\"s*\\\"\\n\\t}, \\n\\t\\\"range\\\": {\\n    \\\"first\\\": 0,\\n    \\\"limit\\\": 3\\n  }, \\n  \\\"sort\\\": {\\n    \\\"by\\\": \\\"users\\\",\\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  \\\"workgroups\\\": [\\n    {\\n      \\\"workgroup\\\": \\\"staff\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 1,\\n        \\\"deleted\\\": 2,\\n        \\\"mailbox\\\": 4,\\n        \\\"total\\\": 5\\n\\t\\t\\t} \\n\\t\\t},\\n    {\\n      \\\"workgroup\\\": \\\"sales\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"deleted\\\": 0,\\n        \\\"mailbox\\\": 1,\\n        \\\"total\\\": 1\\n\\t\\t\\t} \\n\\t\\t},\\n\\t\\t{\\n      \\\"workgroup\\\": \\\"sales_europe\\\",\\n      \\\"counts\\\": {\\n        \\\"filter\\\": 0,\\n        \\\"forward\\\": 0,\\n        \\\"deleted\\\": 0,\\n\\t\\t\\t\\t\\\"mailbox\\\": 0,\\n\\t\\t\\t\\t\\\"total\\\": 0\\n      } \\n    }\\n  ],\\n  \\\"count\\\": 3,\\n  \\\"total_count\\\": 5\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **search_workgroups** method retrieves a list of workgroups in a domain.","slug":"search_workgroups","type":"basic","title":"search_workgroups"}

search_workgroups

The **search_workgroups** method retrieves a list of workgroups in a domain.

## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object>, \n \"criteria\": {\n \"domain\": <domain name>,\n \"match\": <wildcard pattern> \n }\n \"range\":{\n \"first\": <number>, \n \"limit\": <number> \n \"sort\": {\n \"by\": workgroup | users\n \"direction\": ascending | descending\n }\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for search_workgroups" } [/block] The following fields can be used in the **search_workgroups** 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. \n\nAllowed values are:\n\n * **domain** — Specifies the domain to search. This is required.\n\n * **match** — Returns only those workgroups that match the specified pattern. You can use the following wildcards: \n * **?** ― Match a single character\n * ***** ― Match multiple characters.", "1-0": "range", "1-1": "Optional", "1-2": "Limits the results to a subset of those selected by the **criteria** values.\n\nAllowed values are:\n\n * **first** — Specify the first workgroup to return; the default is the first result.\n\n * **limit** — Specify the maximum number of results to return.", "2-0": "sort", "2-1": "Optional", "2-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 * **user** — The number of users in the workgroup.\n \n * **workgroup** — The workgroup name (this is the default).\n\n * **direction** — Specify the sort order. Allowed values are **ascending** (this is the default) or **descending**." }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for search_workgroups" } [/block] The following fields may be returned in response to the **search_workgroups** method: [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 workgroups 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 workgroups 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": "workgroups", "5-1": "Returned if **success = true**", "5-2": "A list of the workgroups that meet the criteria and their attributes. \n\nIncludes the following:\n\n * **counts** — The number of each type of mailbox in the workgroup.\n \n * **filter** — The number of filter only mailboxes (**delivery_filter** attribute set to **true**).\n \n * **forward** — The number of forward only mailboxes (**delivery_forward** attribute set to true and **delivery_local** set to **false**).\n \n * **mailbox** — The number of mailboxes (**delivery_local** attribute set to **true**).\n \n * **total** — The total number of users in the workgroup.\n\n * **workgroup** — The workgroup name." }, "cols": 3, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Examples for search_workgroups" } [/block] ## Example 1 Retrieves all workgroups 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 \"count\": 7,\n \"total_count\": 7,\n \"workgroups\": [\n {\n \"workgroup\": \"contract\",\n \"counts\": {\n \t\"filter\": 0,\n\t\t\t\t\"forward\": 0,\n\t\t\t\t\"mailbox\": 0,\n\t\t\t\t\"total\": 0\n } \n },\n\t\t{\n \t\"workgroup\": \"interns\",\n \t\t\"counts\": {\n \t\t\"filter\": 0,\n \t\t\"forward\": 1,\n \t\t\"mailbox\": 2,\n \t\t\"total\": 3\n }, \n {\n \t\"workgroup\": \"sales\",\n\t\t\t\t\"counts\": {\n \t\t\t\"filter\": 0,\n \t\t\t\"forward\": 0,\n \t\t\t\"mailbox\": 1,\n \t\t\t\"total\": 1\n } \n },\n {\n \t\"workgroup\": \"sales_europe\",\n \t\t\"counts\": {\n \t\t\"filter\": 0,\n \t\t\"forward\": 0,\n \t\t\"mailbox\": 0,\n \t\t\"total\": 0\n } \n },\n {\n \t\"workgroup\": \"staff\",\n \t\t\"counts\": {\n \t\"filter\": 0,\n \"forward\": 1,\n \"mailbox\": 4,\n \"total\": 5\n } \n },\n {\n \t\"workgroup\": \"stock_holders\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 0,\n \"total\": 0\n } \n },\n {\n \t\"workgroup\": \"sysadmins\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 0,\n \"total\": 0\n }\n }\n ],\n}", "language": "perl", "name": " " } ] } [/block] ## Example 2 Retrieves all workgroups that start with 's'. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"domain_admin@example.com\",\n \"password\": \"pencil75\"\n },\n \"criteria\": {\n \"domain\": \"example.com\",\n \"match\": \"s*\"\n } \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"count\": 5,\n \"total_count\": 5,\n \"workgroups\": [\n {\n \t\"workgroup\": \"sales\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 1,\n \"total\": 1\n }\n },\n {\n \t\"workgroup\": \"sales_europe\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 0,\n \"total\": 0\n }\n },\n {\n \t\"workgroup\": \"staff\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 1,\n \"mailbox\": 4,\n \"total\": 5\n }\n },\n {\n \t\"workgroup\": \"stock_holders\",\n\t\t\t\"counts\": {\n \t\t\t\"filter\": 0,\n \t\t\t\"forward\": 0,\n \t\t\t\"mailbox\": 0,\n \t\t\t\"total\": 0\n }\n },\n {\n \t\"workgroup\": \"sysadmins\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 0,\n \"total\": 0\n } \n }\n\t], \n}", "language": "perl", "name": " " } ] } [/block] ## Example 3 Retrieves the first three workgroups that start with 's' 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 \"match\": \"s*\"\n },\n \"range\": {\n \"first\": 0,\n \"limit\": 3\n\t} \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"count\": 3,\n \"total_count\": 5,\n \"workgroups\": [\n {\n \"workgroup\": \"sales\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 1,\n \"total\": 1\n } \n },\n {\n \t\"workgroup\": \"sales_europe\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 0,\n \"total\": 0\n } \n },\n {\n \t\"workgroup\": \"staff\",\n \"counts\": {\n\t\t\t\t\"filter\": 0,\n \"forward\": 1,\n \"mailbox\": 4,\n \"total\": 5\n } \n }\n ], \n}", "language": "perl", "name": " " } ] } [/block] ## Example 4 Retrieves the next three workgroups that start with 's' 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 \"match\": \"s*\"\n\t}, \n\t\"range\": {\n\t\t\"first\": 3,\n\t\t\"limit\": 3 \n \t}\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"count\": 2,\n \"total_count\": 5,\n \"workgroups\": [\n {\n \"workgroup\": \"stock_holders\",\n \t\"counts\": {\n \t\"filter\": 0,\n\t\t\t\t\"forward\": 0,\n\t\t\t\t\"mailbox\": 0,\n\t\t\t\t\"total\": 0\n } \n },\n {\n \t\"workgroup\": \"sysadmins\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"mailbox\": 0,\n \"total\": 0\n\t\t\t} \n\t\t}\n\t], \n}", "language": "perl", "name": " " } ] } [/block] ## Example 5 Retrieves the first three workgroups that start with 's' in the domain example.com, sorting by number of users in the workgroup, in descending order. **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 \"match\": \"s*\"\n\t}, \n\t\"range\": {\n \"first\": 0,\n \"limit\": 3\n }, \n \"sort\": {\n \"by\": \"users\",\n \"direction\": \"descending\"\n }\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"workgroups\": [\n {\n \"workgroup\": \"staff\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 1,\n \"deleted\": 2,\n \"mailbox\": 4,\n \"total\": 5\n\t\t\t} \n\t\t},\n {\n \"workgroup\": \"sales\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"deleted\": 0,\n \"mailbox\": 1,\n \"total\": 1\n\t\t\t} \n\t\t},\n\t\t{\n \"workgroup\": \"sales_europe\",\n \"counts\": {\n \"filter\": 0,\n \"forward\": 0,\n \"deleted\": 0,\n\t\t\t\t\"mailbox\": 0,\n\t\t\t\t\"total\": 0\n } \n }\n ],\n \"count\": 3,\n \"total_count\": 5\n}", "language": "perl", "name": " " } ] } [/block]