Accounts-account-email-domain-usernames-mailboxName-forwards:POST

From Hostway API Documentation
Revision as of 15:24, 15 November 2013 by Mike.robski (Talk | contribs)
Jump to: navigation, search

POST accounts/{account}/email/{domain}/usernames/{mailbox}/forwards

Sets forwarding for specified mailbox,domain and account.

Contents


Request

POST accounts/{account}/email/{domain}/usernames/{mailbox}/forwards

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


Request Body

{
    "targets": [
        {"target": "{target-email}"},
        {"target": "{target-email1}"},
    ]
}
 


Parameters

targets - list
List of target objects.
target - string
The target mailbox to forward to.

Response

Status Code

204 No Content
Success
400 Bad Request
The format of the request body is invalid or the username does not meet the requirements.
401 Unauthorized
The supplied credentials are invalid or do not provide permissions for this operation.
404 Not Found
The domain name does not exist.

Examples

Failure setting forwarding with missing required parameter

Request

POST accounts/{account}/email/test.com/usernames/test/forwards

{empty request body}
 

Response

400 Bad Request

{"targets":"Required"}
 


Failure setting forwarding by not providing target

Request

POST accounts/{account}/email/test.com/usernames/test/forwards

{"targets":[]}
 

Response

400 Bad Request

{"targets": "Shorter than minimum length 1"}
 

Success setting forwarding

Request

POST accounts/{account}/email/test.com/usernames/test/forwards

{
    "targets": [
        {"target": "test-fwd@test.com"}
    ]
}
 

Response

204 No Content


Success setting forwards

Request

POST accounts/{account}/email/test.com/usernames/test/forwards

{
    "targets": [
        {"target": "test-fwd@test.com"},
        {"target": "test-fwd1@test.com"}
    ]
}
 

Response

204 No Content

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox