Accounts-account-email-domain-usernames:GET
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 87) |
Corinne.chui (Talk | contribs) m (1 revision) |
||
| (5 intermediate revisions by 3 users not shown) | |||
| Line 47: | Line 47: | ||
<nowiki> | <nowiki> | ||
{ | { | ||
| + | "totalCount": "{count}", | ||
"list": [ | "list": [ | ||
{ | { | ||
"username": "{username}", | "username": "{username}", | ||
| + | "webmailAccess": "{webmailAccess}", | ||
| + | "links": [ | ||
| + | { | ||
| + | "href": "{href}", | ||
| + | "rel": "{rel}" | ||
| + | } | ||
| + | ], | ||
| + | "type": {type}, | ||
| + | "quota": {quota}, | ||
"master": {master}, | "master": {master}, | ||
| − | |||
| − | |||
"trialType": "{trialType}", | "trialType": "{trialType}", | ||
| − | "trialExpiration": "{trialExpiration}" | + | "trialExpiration": "{trialExpiration}", |
| + | "allowUpgrade": {allowUpgrade} | ||
} | } | ||
], | ], | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
} | } | ||
</nowiki> | </nowiki> | ||
==== Parameters ==== | ==== Parameters ==== | ||
| + | ; total count - ''integer'' | ||
| + | ; The total number of mailboxes under the domain | ||
| + | |||
; username - ''string'' | ; username - ''string'' | ||
: The username of an individual mailbox | : The username of an individual mailbox | ||
| Line 78: | Line 85: | ||
; webmailAccess - ''string'' | ; webmailAccess - ''string'' | ||
: (OPTIONAL) | : (OPTIONAL) | ||
| − | : The type of webmail of the mailbox. Allowed values | + | : The type of webmail of the mailbox. Allowed values can be obtained from the [[Accounts-account-email-domain-webmailNames:GET|webmailNames API endpoint]]. Will only be displayed if the user passed the details URI parameter |
| − | ; trialType - ''string'' | + | ; trialType - ''string'' |
| − | : Trial account type set for a given period of time. | + | : Trial account type set for a given period of time. Supported values can be obtained from the [[Accounts-account-email-domain-webmailNames:GET|webmailNames API endpoint]]. |
; trialExpiration - ''date'' - YYYY-mm-dd | ; trialExpiration - ''date'' - YYYY-mm-dd | ||
| Line 103: | Line 110: | ||
<nowiki> | <nowiki> | ||
{ | { | ||
| + | "totalCount": 1, | ||
"list": [ | "list": [ | ||
{ | { | ||
"username": "test", | "username": "test", | ||
| − | " | + | "links": [ |
| + | { | ||
| + | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test/mailbox/", | ||
| + | "rel": "self" | ||
| + | } | ||
| + | ], | ||
| + | "type": "imap" | ||
"quota": 10, | "quota": 10, | ||
| + | "master": false, | ||
"trialType": "premium", | "trialType": "premium", | ||
| − | "trialExpiration": "2018-10-28" | + | "trialExpiration": "2018-10-28", |
| + | "allowUpgrade": true | ||
} | } | ||
| − | ] | + | ] |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
} | } | ||
</nowiki> | </nowiki> | ||
| Line 130: | Line 140: | ||
<nowiki> | <nowiki> | ||
{ | { | ||
| + | "totalCount": 1, | ||
"list": [ | "list": [ | ||
{ | { | ||
"username": "test", | "username": "test", | ||
| − | " | + | "webmailAccess": "standard", |
| − | "quota": 10, | + | "links": [ |
| − | " | + | { |
| + | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test/mailbox/", | ||
| + | "rel": "self" | ||
| + | } | ||
| + | ], | ||
| + | "type": "imap" | ||
| + | "quota": 10, | ||
| + | "master": false, | ||
| + | "trialType": "premium", | ||
| + | "trialExpiration": "2018-10-28", | ||
| + | "allowUpgrade": true | ||
} | } | ||
| − | ] | + | ] |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
} | } | ||
</nowiki> | </nowiki> | ||
| − | === Paginated request === | + | === Paginated request with sort order === |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
| − | GET accounts/test-account123/email/test.com/usernames?page=2&pageSize=2 | + | GET accounts/test-account123/email/test.com/usernames?page=2&pageSize=2&sortField=username&sortOrder=desc |
</nowiki> | </nowiki> | ||
'''Response''' | '''Response''' | ||
<nowiki> | <nowiki> | ||
| − | { | + | { |
| + | "totalCount": 6, | ||
"list": [ | "list": [ | ||
{ | { | ||
| − | "username": " | + | "username": "test2", |
| − | " | + | "links": [ |
| − | "quota": 10 | + | { |
| + | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test2/mailbox/", | ||
| + | "rel": "self" | ||
| + | } | ||
| + | ], | ||
| + | "type": "imap", | ||
| + | "quota": 10, | ||
| + | "master": true, | ||
| + | "trialType": "premium", | ||
| + | "trialExpiration": "2018-10-28", | ||
| + | "allowUpgrade": true | ||
}, | }, | ||
{ | { | ||
| − | "username": " | + | "username": "test1", |
| − | " | + | "links": [ |
| − | "quota": | + | { |
| + | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test1/mailbox/", | ||
| + | "rel": "self" | ||
| + | } | ||
| + | ], | ||
| + | "type": "imap", | ||
| + | "quota": 10, | ||
| + | "master": false, | ||
| + | "trialType": "premium", | ||
| + | "trialExpiration": "2018-10-28", | ||
| + | "allowUpgrade": true | ||
} | } | ||
], | ], | ||
"links": [ | "links": [ | ||
| − | |||
| − | |||
| − | |||
| − | |||
{ | { | ||
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=1&pageSize=2", | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=1&pageSize=2", | ||
| Line 188: | Line 220: | ||
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=3&pageSize=2", | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=3&pageSize=2", | ||
"rel": "last" | "rel": "last" | ||
| + | }, | ||
| + | { | ||
| + | "href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=2&pageSize=2", | ||
| + | "rel": "self" | ||
} | } | ||
] | ] | ||
| Line 194: | Line 230: | ||
== See also == | == See also == | ||
| − | * [[Email | + | * [[Email API|Email API]] |
{{disqus}} | {{disqus}} | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:Email API]] | [[Category:Email API]] | ||
Latest revision as of 14:36, 30 May 2016
[edit] GET /accounts/{account}/email/{domain}/usernames
Retrieves a list of mailboxes for a specific account and domain
Contents |
[edit] Request
GET /accounts/{account}/email/{domain}/usernames
[edit] 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
[edit] 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
[edit] Response
[edit] 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.
[edit] Response Body
{
"totalCount": "{count}",
"list": [
{
"username": "{username}",
"webmailAccess": "{webmailAccess}",
"links": [
{
"href": "{href}",
"rel": "{rel}"
}
],
"type": {type},
"quota": {quota},
"master": {master},
"trialType": "{trialType}",
"trialExpiration": "{trialExpiration}",
"allowUpgrade": {allowUpgrade}
}
],
}
[edit] Parameters
- total count - integer
- The total number of mailboxes under the domain
- 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 can be obtained from the webmailNames API endpoint. Will only be displayed if the user passed the details URI parameter
- trialType - string
- Trial account type set for a given period of time. Supported values can be obtained from the webmailNames API endpoint.
- 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
[edit] Examples
[edit] Success scenario
Request
GET accounts/test-account123/email/test.com/usernames
Response
{
"totalCount": 1,
"list": [
{
"username": "test",
"links": [
{
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test/mailbox/",
"rel": "self"
}
],
"type": "imap"
"quota": 10,
"master": false,
"trialType": "premium",
"trialExpiration": "2018-10-28",
"allowUpgrade": true
}
]
}
[edit] Request with webmailAccess
Request
GET accounts/test-account123/email/test.com/usernames?details=1
Response
{
"totalCount": 1,
"list": [
{
"username": "test",
"webmailAccess": "standard",
"links": [
{
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test/mailbox/",
"rel": "self"
}
],
"type": "imap"
"quota": 10,
"master": false,
"trialType": "premium",
"trialExpiration": "2018-10-28",
"allowUpgrade": true
}
]
}
[edit] Paginated request with sort order
Request
GET accounts/test-account123/email/test.com/usernames?page=2&pageSize=2&sortField=username&sortOrder=desc
Response
{
"totalCount": 6,
"list": [
{
"username": "test2",
"links": [
{
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test2/mailbox/",
"rel": "self"
}
],
"type": "imap",
"quota": 10,
"master": true,
"trialType": "premium",
"trialExpiration": "2018-10-28",
"allowUpgrade": true
},
{
"username": "test1",
"links": [
{
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames/test1/mailbox/",
"rel": "self"
}
],
"type": "imap",
"quota": 10,
"master": false,
"trialType": "premium",
"trialExpiration": "2018-10-28",
"allowUpgrade": true
}
],
"links": [
{
"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"
},
{
"href": "{{APIBaseURL}}/accounts/test-account123/email/test.com/usernames?page=2&pageSize=2",
"rel": "self"
}
]
}
[edit] See also