POST Exchange Mailbox

From Hostway API Documentation
Jump to: navigation, search

Create an Exchange mailbox

POST /accounts/{account_number}/exchange/{domain_name}/mailboxes

Contents

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

Request Body

 {
  "owner": {
    "username": "john2",
    "password": "secret2"
  },
  "admin": 0,
  "notes": "some text",
  "recipientLimit": 10,
  "deliverRedirect": "zsds",
  "forwardTo": "asdasd",
  "name": {
    "name": "John Smith",
    "company": "My Company",
    "department": "Sales",
    "title": "President"
  },
  "address": {
    "address": "100 Main St.",
    "city": "Chicago",
    "state": "IL",
    "zip": "60001",
    "country": "US"
  },
  "phones": {
    "businessPhone": "555-555-5501",
    "homePhone": "555-555-5502",
    "fax": "555-555-5503",
    "mobile": "555-555-5504"
  }
}
  
owner - dictionary
-Contains attributes related to the mailbox user
username - string
-The handle of the mailbox that is to be created
Allowed are lower only letters, numbers, underscores, dashes
Cannot use reserved words: "ADMINISTRATOR", "ADMINS", "HELPDESK"
Length 1 to 25
password - string
-The password required to access the new mailbox
Length 8 to 20 , Must not contain only lower case letters,
Must contain letters, should be one word , and Password should have at least one digit
admin - integer
-Whether the mailbox user will have administrative privileges
Allowed values are 0 or 1
notes - string
-User defined textual description
recipientLimit - integer
-Specifies the recipient limit for the mailbox. Allowed values are integers from 1 to 100.
deliverRedirect - string
-Redirect address
forwardTo - string
-Forward address
name - dictionary
name - string
company - string
department - string
title - string
address - dictionary
-Specifies the address details for the mailbox
address - string
city - string
state - string
zip - string
country - string
phones - dictionary
-Specifies phone details for the mailbox
businessPhone - string
homePhone - string
fax - string
mobile - string

Response Codes

200
Success
202
Accepted
404
Non-existent resource
405
Unsupported method
409
Duplicate entry
502
Internal server error

Examples

POST {server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes

- Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

- Request Body:

{
  "owner": {
    "username": "test-username",
    "password": "secret2"
  },
  "admin": 0,
  "notes": "some text",
  "recipientLimit": 10,
  "deliverRedirect": "zsds",
  "forwardTo": "asdasd",
  "name": {
    "name": "John Smith",
    "company": "My Company",
    "department": "Sales",
    "title": "President"
  },
  "address": {
    "address": "100 Main St.",
    "city": "Chicago",
    "state": "IL",
    "zip": "60001",
    "country": "US"
  },
  "phones": {
    "businessPhone": "555-555-5501",
    "homePhone": "555-555-5502",
    "fax": "555-555-5503",
    "mobile": "555-555-5504"
  }
}

- Response: Accepted (202):

{
  "links": [
    {
      "href": "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/", 
      "rel": "self"
    }, 
    {
      "href": "http://{server_name}/orders/{order_id}/action", 
      "rel": "related"
    },
    {
      "href": "http://{server_name}/orders/{order_id}/account/products/{product_id}/services/{newly_created_mailbox_service_id}",
      "rel": "edit"
    }
  ]
 }

- Response when adding an optional mailbox: Success (202):

{
  "total": ["8.00", "USD"], 
  "subtotal": ["8.00", "USD"], 
  "deferredTotal": ["8.00", "USD"], 
  "deferredSubtotal": ["8.00", "USD"], 
  "quotehash": "{quote_id}", 
  "links": [
    {
      "href": "http://{server_name}/accounts/{account_number}/exchange/{domain_name}/mailboxes/", 
      "rel": "self"
    }, 
    {
      "href": "http://{server_name}/orders/{order_id}/action", 
      "rel": "related"
    },
    {
      "href": "http://{server_name}/orders/{order_id}/account/products/{product_id}/services/{newly_created_mailbox_service_id}",
      "rel": "edit"
    }
  ]
}




- Request Body with Invalid data:

{
  "owner": {
    "username": "(^%*&^*&^)*",
    "password": "weakpass"
  },
  "admin": 0,
  "notes": "",
  "recipientLimit": 10,
  "deliverRedirect": "zsds",
  "forwardTo": "asdasd",
  "name": {
    "name": "John Smith",
    "company": "My Company",
    "department": "Sales",
    "title": "President"
  },
  "address": {
    "address": "100 Main St.",
    "city": "Chicago",
    "state": "IL",
    "zip": "60001",
    "country": "US"
  },
  "phones": {
    "businessPhone": "555-555-5501",
    "homePhone": "555-555-5502",
    "fax": "555-555-5503",
    "mobile": "555-555-5504"
  }
}

- Response: BadRequest (400):

{
 "badRequest": {"message": "POST data error", "code": 400, 
                "details": {"notes": "Required", 
                            "owner.username": "Has invalid characters.Allowed are lower only letters, numbers, underscores, dashes", 
                            "owner.password": "Must not contain only lower case letters"}
               }
}
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox