{"_id":"56b006d33c70b01700facf63","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"},"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","githubsync":"","project":"569f9cf6650e1d1900f96b5b","__v":24,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-02T01:30:59.043Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object> \\n    \\\"criteria\\\": {\\n        \\\"company\\\": <company>,\\n        \\\"type\\\": [<one or more of company, domain, mail, workgroup], \\n        \\\"match\\\": <wildcard pattern>\\n    }\\n    \\\"range\\\": {\\n        \\\"first\\\": <number>, \\n        \\\"limit\\\": <number>\\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_admins\"\n}\n[/block]\nThe following fields can be used in the **search_admins** 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\": \"Optional\",\n    \"0-2\": \"Narrows the results by restricting the search to the specified fields and their values.\\n\\nAllowed values are:\\n\\n  * **company** — The company to search for admins. If not specified, the requester's company is used.\\n\\n  * **match** — Returns only those admins whose user names matches the specified pattern. You can use the following wildcards:\\n\\n  * **?** ― Match a single character\\n\\n* ***** ― Match a string of characters.\\n\\n* **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. \\n\\n**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.\",\n    \"1-0\": \"range\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"Limits the range of admins to display. Allowed values are:\\n\\n  * **first** — The 0-based index of the first admin to return; the default is the first result.\\n\\n  * **limit** — The maximum number of results to return.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for search_admins\"\n}\n[/block]\nThe following fields may be returned when the **search_admins** 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\": \"admins\",\n    \"0-1\": \"Returned if **success = true**\",\n    \"1-1\": \"Returned if **success = true**\",\n    \"2-1\": \"Returned if **success = false**\",\n    \"3-1\": \"Returned if **success = false**\",\n    \"5-1\": \"Returned if **success = true**\",\n    \"0-2\": \"A list of the admins that meet the criteria and their attributes. \\nAllowed values are:\\n\\n  * **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.\\n  \\n  * **type** — The type of admin. Allowed values are: **company, domain, mail**, and **workgroup**.\\n  \\n  * **user** — The admin's user name.\",\n    \"1-0\": \"count\",\n    \"1-2\": \"The number of admins returned.\",\n    \"2-0\": \"error\",\n    \"2-2\": \"A text string that explains the error.\",\n    \"3-0\": \"error_number\",\n    \"3-2\": \"A number that represents the error.\",\n    \"4-0\": \"success\",\n    \"4-1\": \"Always returned\",\n    \"4-2\": \"Indicates whether the request was successful or not. Allowed values are true and false.\",\n    \"5-0\": \"total_count\",\n    \"5-2\": \"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.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for search_admins\"\n}\n[/block]\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin:::at:::example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\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  \\\"count\\\": 3,\\n  \\\"total_count\\\": 3\\n  \\\"admins\\\": [\\n    {\\n      \\\"user\\\": \\\"company_admin@example.adm\\\", \\n      \\\"type\\\": \\\"company\\\",\\n      \\\"control\\\": [\\n        \\\"Example Corp\\\"\\n      ]\\n    }, \\n    {\\n      \\\"user\\\": \\\"domain_admin@example.com\\\",\\n      \\\"type\\\": \\\"domain\\\",\\n      \\\"control\\\": [\\n        \\\"example.com\\\"\\n      ]\\n    },\\n    {\\n      \\\"user\\\": \\\"mrmanager@example.com\\\",\\n      \\\"type\\\": \\\"workgroup\\\",\\n      \\\"control\\\": [\\n        \\\"example.com/sales\\\"\\n      ]\\n    } \\n  ],\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **search_admins method** retrieves a list of the admins in a specified company.","slug":"search_admins","type":"basic","title":"search_admins"}

search_admins

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

## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object> \n \"criteria\": {\n \"company\": <company>,\n \"type\": [<one or more of company, domain, mail, workgroup], \n \"match\": <wildcard pattern>\n }\n \"range\": {\n \"first\": <number>, \n \"limit\": <number>\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for search_admins" } [/block] The following fields can be used in the **search_admins** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "criteria", "0-1": "Optional", "0-2": "Narrows the results by restricting the search to the specified fields and their values.\n\nAllowed values are:\n\n * **company** — The company to search for admins. If not specified, the requester's company is used.\n\n * **match** — Returns only those admins whose user names matches the specified pattern. You can use the following wildcards:\n\n * **?** ― Match a single character\n\n* ***** ― Match a string of characters.\n\n* **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. \n\n**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.", "1-0": "range", "1-1": "Optional", "1-2": "Limits the range of admins to display. Allowed values are:\n\n * **first** — The 0-based index of the first admin to return; the default is the first result.\n\n * **limit** — The maximum number of results to return." }, "cols": 3, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for search_admins" } [/block] The following fields may be returned when the **search_admins** method is submitted: [block:parameters] { "data": { "h-0": "Field name ", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "admins", "0-1": "Returned if **success = true**", "1-1": "Returned if **success = true**", "2-1": "Returned if **success = false**", "3-1": "Returned if **success = false**", "5-1": "Returned if **success = true**", "0-2": "A list of the admins that meet the criteria and their attributes. \nAllowed values are:\n\n * **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.\n \n * **type** — The type of admin. Allowed values are: **company, domain, mail**, and **workgroup**.\n \n * **user** — The admin's user name.", "1-0": "count", "1-2": "The number of admins returned.", "2-0": "error", "2-2": "A text string that explains the error.", "3-0": "error_number", "3-2": "A number that represents the error.", "4-0": "success", "4-1": "Always returned", "4-2": "Indicates whether the request was successful or not. Allowed values are true and false.", "5-0": "total_count", "5-2": "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." }, "cols": 3, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Examples for search_admins" } [/block] **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n }\n}\n", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"count\": 3,\n \"total_count\": 3\n \"admins\": [\n {\n \"user\": \"company_admin@example.adm\", \n \"type\": \"company\",\n \"control\": [\n \"Example Corp\"\n ]\n }, \n {\n \"user\": \"domain_admin@example.com\",\n \"type\": \"domain\",\n \"control\": [\n \"example.com\"\n ]\n },\n {\n \"user\": \"mrmanager@example.com\",\n \"type\": \"workgroup\",\n \"control\": [\n \"example.com/sales\"\n ]\n } \n ],\n}", "language": "perl", "name": " " } ] } [/block]