Accounts-account-email-domain-usernames-mailboxName-blackwhitelist:GET
From Hostway API Documentation
Revision as of 12:14, 24 July 2015 by Mike.robski (Talk | contribs)
GET /accounts/{account}/email/{domain}/usernames/{mailbox}/blackwhitelist
Retrieves a list of all addresses included in black/white list for a specific mailbox
Contents |
Request
GET /accounts/{account}/email/{domain}/usernames/{mailbox}/blackwhitelist
URI Parameters
- account - string
- domain - string
- mailbox - string
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
- Content-Type
- Required. Set this header to
application/json; charset=UTF-8
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 the mailbox does not exist.
Response Body
{ "totalCount": {totalCount}, "list": [ { "type": "{type}", "address": "{address}" } ], "links": [ { "href": "{href}", "rel": "{rel}" } ] }
Parameters
- totalCount - int
- The total count of addresses included in black/white list
- type - string
- Type of address included in black/white list. Possible values are "W" or "B". "W" means the adrress is included in "whitelist", "B" - included in "blacklist".
- address - string
- The address of the black/whitelisted mailbox or domain.
- links - list
- Hypermedia to the get black/whitelisted addresses
Examples
Get all addresses included in black/white list
Request
GET /accounts/account-number/email/test.com/usernames/test/blackwhitelist
Response
200 OK { "totalCount": 4, "list": [ { "type": "W", "address": "mb1-white@somedomain.com" }, { "type": "B", "address": "mb2-black@domain.com" }, { "type": "B", "address": "mb3-black@somedomain.com" }, { "type": "B", "address": "@sometestdomain.com" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/usernames/test/blackwhitelist", "rel": "self" } ] }
Get filtered list by address
Request
GET /accounts/account-number/email/test.com/usernames/test/blackwhitelist?filterAddress=*somedomain.com*
Response
200 OK { "totalCount": 2, "list": [ { "type": "W", "address": "mb1-white@somedomain.com" }, { "type": "B", "address": "mb3-black@somedomain.com" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/usernames/test/blackwhitelist?filterAddress=*somedomain.com*", "rel": "self" } ] }
Get filtered list by type
Request
GET /accounts/account-number/email/test.com/usernames/test/blackwhitelist?filterType=W
Response
200 OK { "totalCount": 1, "list": [ { "type": "W", "address": "mb1-white@somedomain.com" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/usernames/test/blackwhitelist?filterType=W", "rel": "self" } ] }
Paginated request
Request
GET /accounts/account-number/email/test.com/usernames/test/blackwhitelist?pageSize=2&page=1
Response
200 OK { "totalCount": 2, "list": [ { "type": "W", "address": "mb1-white@somedomain.com" }, { "type": "B", "address": "mb2-white@domain.com" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/usernames/test/blackwhitelist?pageSize=2&page=2", "rel": "next" }, { "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/usernames/test/blackwhitelist?pageSize=2&page=2", "rel": "last" } ] }
Sorted request
Request
GET /accounts/account-number/email/test.com/usernames/test/blackwhitelist?sortField=address&sortOrder=desc
Response
200 OK { "totalCount": 4, "list": [ { "type": "B", "address": "mb3-black@somedomain.com" }, { "type": "B", "address": "mb2-black@domain.com" }, { "type": "W", "address": "mb1-white@somedomain.com" }, { "type": "B", "address": "@sometestdomain.com" } ], "links": [ { "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/usernames/test/blackwhitelist?sortField=address&sortOrder=desc", "rel": "self" } ] }