GET Exchange Mailboxes list

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Response Body)
 
m (1 revision: Release 95)
 

Latest revision as of 23:59, 1 July 2014

GET /accounts/account-number/exchange/domain-name/mailboxes

Retrieve an Exchange Mailboxes list by domain name

Contents


Request

GET /accounts/account-number/exchange/domain-name/mailboxes

GET /accounts/account-number/exchange/domain-name/mailboxes?page=page-num&pageSize=page-size&sortField=sort-field&sortOrder=sort-order&filter-field=filter-value&includeAddOns=add-ons

Request Parameters

account-number - string
The account-number that the Exchange resource belongs to
domain-name - string
The domain-name that is associated with the Exchange resource

URI Parameters

page-num- int
(OPTIONAL)
Request a specific page of data. If not set defaults to 1
page-size - int
(OPTIONAL)
Size used to paginate the request. If not set defaults to 100
sort-field - string
(OPTIONAL)
Specifies a field upon which to sort the data. If not set no sorting is preformed. Allowed values are specified by an OPTIONS request
sort-order - string
(OPTIONAL)
Specifies the order in which the data is sorted. If not set no sorting is preformed if sort-field is not set or defaults to asc otherwise. Allowed values are specified by an OPTIONS request
filter-field - string
(OPTIONAL)
Specifies a field upon which the data is filtered. If multiple filter-field are set all of them have to be true to pass the filter. If none are set no filtering is performed. Allowed values are specified by an OPTIONS request. Example: if we want to filter by field 'status' then the parameter should look like 'filterStatus=value'. That way one can filter by more then one field.
Note: An exception from the common rules for filtering is the filterBillingStatus parameter. We might have following situations:
* filterBillingStatus is not passed - Returns mailboxes that are currently provisioning or has already been provisioned
* filterBillingStatus=new - Returns mailboxes from orders that haven't been submitted yet
* filterBillingStatus=placed - Returns mailboxes froms orders that have been submitted but not passed the billing yet i.e. the provisioning has started yet
* filterBillingStatus={status} - Returns mailboxes for which the provisioning process has already been initiated. Allowed values for {status} are pending, open, suspended, close_pending, closed and purge_pending
filter-value - string
(OPTIONAL)
A value with which the filter-field is filtered. Values are exact match or defined with Filter Values Wildcards. Additional restrictions may be specified by an OPTIONS request
add-ons- int
(OPTIONAL)
Specifies whether to display blackberry and archiving availability for each mailbox. Valid values are 0 and 1. If not set defaults to 0.

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.

Response Body

{
   "list" :
      [
         {
             "billingStatus" : {billingStatus},
             "username" : {username},
             "blackberry" : 1,
             "archiving" : 1,
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/{username}"
         }
      ]
   "links":
      [
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes",
            "rel" : "self"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?includeAddOns=1",
            "rel" : "alternate"
         }
      ]
}
  
list - list
List of the mailboxes for the selected domain. Each element of the list has the following attributes:
username - string
The username of the mailbox
billingStatus - string
Current status of the mailbox. Allowed values are new, so_item_new, so_item_placed, pending, open, suspended, close_pending, closed and purge_pending
new means that the mailboxes are from orders that haven't been placed yet
so_item_new and so_item_placed mean that the mailboxes are from orders that are placed but haven't passed the billing process yet
blackberry - string
(OPTIONAL)
Displays whether blackberry is enabled for that contact. Allowed values are 0 and 1. It is included in the body only when the includeAddOns URI parameter is equal to 1.
archiving - string
(OPTIONAL)
Displays whether archiving is enabled for that contact. Allowed values are 0 and 1 It is included in the body only when the includeAddOns URI parameter is equal to 1.
details - string
Hyperlink to the mailbox
links - list
Hypermedia for this resource. Link to self will preserve filtering, sorting and pagination set by the request. Links to the first, last, previous and next pages will also be included if applicable

Expected Response Codes

200
Success
400
Bad request
This is usually a sign that the client attempted to use filtering/sorting criteria that are invalid for this resource
404
Non-existent resource
Returned if no Exchange service could be found for the given domain name.
405
Unsupported method
500
Internal server error
502
Bad gateway
There was a failure in an upstream service that caused a failure in the API.

Examples

Get mailboxes from orders that haven't been submitted yet

GET http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?filterBillingStatus=new
 
{
   "list" :
      [
         {
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/user1",
             "billingStatus" : "new",
             "username" : "user1"
         },
         {
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/user2",
             "billingStatus" : "new",
             "username" : "user2"
         }
      ]
   "links":
      [
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?filterBillingStatus=new",
            "rel" : "self"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?filterBillingStatus=new&includeAddOns=1",
            "rel" : "alternate"
         }
      ]
}
  

Get mailboxes from orders that have been placed but haven't passed the billing yet

GET http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?filterBillingStatus=placed
 
{
   "list" :
      [
         {
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/user1",
             "billingStatus" : "so_item_new",
             "username" : "user1"
         },
         {
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/user2",
             "billingStatus" : "so_item_placed",
             "username" : "user2"
         }
      ]
   "links":
      [
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?filterBillingStatus=placed",
            "rel" : "self"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?filterBillingStatus=placed&includeAddOns=1",
            "rel" : "alternate"
         }
      ]
}
  

Get fully provisioned mailboxes with pagination

GET http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?page=2&pageSize=2
 
{
   "list" :
      [
         {
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/user1",
             "billingStatus" : "open",
             "blackberry" : 1,
             "archiving" : 1,
             "username" : "user1"
         },
         {
             "details" : "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/user2",
             "billingStatus" : "closed",
             "blackberry" : 0,
             "archiving" : 0,
             "username" : "user2"
         }
      ]
   "links":
      [
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?page=2&pageSize=2",
            "rel" : "self"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?page=1&pageSize=2",
            "rel" : "first"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?page=1&pageSize=2",
            "rel" : "previous"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?page=3&pageSize=2",
            "rel" : "next"
         },
         {
            "href" : "http://{server_name}/accounts/{account-number}/exchange/{domain-name}/mailboxes?page=3&pageSize=2",
            "rel" : "last"
         }
      ]
}
  
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox