Accounts-account-email-domain-usernames:GET
From Hostway API Documentation
Revision as of 15:24, 15 November 2013 by Mike.robski (Talk | contribs)
GET /accounts/{account}/email/{domain}/usernames
Retrieves a list of mailboxes for a specific account and domain
Contents |
Request
GET /accounts/{account}/email/{domain}/usernames
Request Parameters
- account - string
- The user account owning the domain and the mailboxes
- domain - string
- The specific domain for which the call will retrieve the list
URI Parameters
- filterUsername - string
- Only mailboxes with username matching the value of the parameter will be returned. The values used could be specified as a partial match with a wildcard(*).
- page - integer
- Specifies which page should be displayed. Requires a pageSize parameter to also be provided
- pageSize - integer
- Specifies the number of entries to be displayed on a page. Requires a page parameter to also be provided
- sortField - string
- Specifies if the resulting list is to be sorted by a given field. Allowed values are username and quota
- sortOrder - string
- The order in which the sorting is to be done. Allowed values are asc and desc
- details - integer
- If set to 1 the type of mailbox users will be displayed for each mailbox
Response
Status Code
- 200 OK
- Success
- 401 Unauthorized
- The supplied credentials are invalid or do not provide permissions for this operation.
- 404 Not Found
- The domain name or account does not exist.
Response Body
{ "list": [ { "username": "{username}", "master": {master}, "quota": {quota}, "webmailAccess": "{webmailAccess}", "trialType": "{trialType}", "trialExpiration": "{trialExpiration}" } ], "links": [ { "href": "{href}", "rel": "{rel}" } ] }
Parameters
- username - string
- The username of an individual mailbox
- master - integer
- Allowed values are 0 or 1
- quota - integer
- The quota of the mailbox in Megabytes
- webmailAccess - string
- (OPTIONAL)
- The type of webmail of the mailbox. Allowed values are standard, activesync and premium. Will only be displayed if the user passed the details URI parameter
- trialType - string - one of "standard", "activesync" or "premium"
- Trial account type set for a given period of time. Values are standard, activesync, premium.
- trialExpiration - date - YYYY-mm-dd
- Expiration date of trial period formatted as YYYY-mm-dd.
- href - string
- Link to other resources relevant to the mailboxes lists
- rel - string
- Type of relation to the resource for the provided link
Examples
Success scenario
Request
GET accounts/test-account123/email/test.com/usernames
Response
{ "list": [ { "username": "test", "master": 1, "quota": 10, "trialType": "premium", "trialExpiration": "2018-10-28" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/", "rel": "self" } ] }
Request with webmailAccess
Request
GET accounts/test-account123/email/test.com/usernames?details=1
Response
{ "list": [ { "username": "test", "master": 1, "quota": 10, "webmailAccess": "standard" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/", "rel": "self" } ] }
Paginated request
Request
GET accounts/test-account123/email/test.com/usernames?page=2&pageSize=2
Response
{ "list": [ { "username": "test1", "master": 1, "quota": 10 }, { "username": "test2", "master": 1, "quota": 15 } ], "links": [ { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=2&pageSize=2", "rel": "self" }, { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=1&pageSize=2", "rel": "first" }, { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=1&pageSize=2", "rel": "previous" }, { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=3&pageSize=2", "rel": "next" }, { "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=3&pageSize=2", "rel": "last" } ] }
See also