Accounts-account-email-domain-blackwhitelist:GET

From Hostway API Documentation
Revision as of 10:06, 6 February 2015 by Mike.robski (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GET /accounts/{account}/email/{domain}/blackwhitelist

Retrieves a list of all addresses included in black/white list for a specific domain

Contents


Request

GET /accounts/{account}/email/{domain}/blackwhitelist

URI Parameters

account - string
domain - 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 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 mailbox is included in "whitelist", "B" - included in "blacklist".
address - string
The address of the black/whitelisted mailbox.
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/blackwhitelist
 

Response

200 OK

{
   "totalCount": 3, 
   "list": [
      {
         "type": "W", 
         "address": "mb1-white@somedomain.com"
      }, 
      {
         "type": "B", 
         "address": "mb2-black@domain.com"
      },
      {
         "type": "B", 
         "address": "mb3-black@somedomain.com"
      }
   ],
   "links": [
        {
            "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/blackwhitelist",
            "rel": "self"
        }
    ]
}
 

Get filtered list by address

Request

GET /accounts/account-number/email/test.com/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/blackwhitelist?filterAddress=*somedomain.com*",
            "rel": "self"
        }
    ]
}
 

Get filtered list by type

Request

GET /accounts/account-number/email/test.com/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/blackwhitelist?filterType=W",
            "rel": "self"
        }
    ]
}
 

Paginated request

Request

GET /accounts/account-number/email/test.com/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/blackwhitelist?pageSize=2&page=2",
            "rel": "next"
        },
        {
            "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/blackwhitelist?pageSize=2&page=2",
            "rel": "last"
        }
    ]
}
 

Sorted request

Request

GET /accounts/account-number/email/test.com/blackwhitelist?sortField=address&sortOrder=desc
 

Response

200 OK

{
   "totalCount": 3, 
   "list": [
      {
         "type": "B", 
         "address": "mb3-black@somedomain.com"
      },
      {
         "type": "B", 
         "address": "mb2-black@domain.com"
      },
      {
         "type": "W", 
         "address": "mb1-white@somedomain.com"
      }
   ],   
   "links": [
        {
            "href": "{{APIBaseURL}}/accounts/account-number/email/test.com/blackwhitelist?sortField=address&sortOrder=desc",
            "rel": "self"
        }
    ]
}
 


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox