Accounts-account-email-domain-usernames-mailboxName-forwards:POST
(→Creating local forwarding or distribution list that contains mailboxes in the source domain) |
Mike.robski (Talk | contribs) m (1 revision: Release 95) |
||
Line 57: | Line 57: | ||
== Examples == | == Examples == | ||
− | === Failure | + | === Failure setting forwarding with missing required parameter === |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 72: | Line 72: | ||
</nowiki> | </nowiki> | ||
− | === Failure | + | |
+ | === Failure setting forwarding by not providing target === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 87: | Line 88: | ||
</nowiki> | </nowiki> | ||
− | === Success | + | === Success setting forwarding === |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 94: | Line 95: | ||
{ | { | ||
"targets": [ | "targets": [ | ||
− | {"target": "test-fwd@ | + | {"target": "test-fwd@test.com"} |
] | ] | ||
} | } | ||
Line 104: | Line 105: | ||
</nowiki> | </nowiki> | ||
− | === Success setting | + | |
+ | === Success setting forwards === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 112: | Line 114: | ||
"targets": [ | "targets": [ | ||
{"target": "test-fwd@test.com"}, | {"target": "test-fwd@test.com"}, | ||
− | {"target": "test-fwd1@ | + | {"target": "test-fwd1@test.com"} |
] | ] | ||
} | } | ||
Line 122: | Line 124: | ||
</nowiki> | </nowiki> | ||
− | === | + | === Setting forwarding with local storage === |
− | + | In order to have local storage for forwarding, target mailboxes have to be in the same local domain as the source mailbox.<br> | |
− | + | So the previous two examples of successful setup of forwarding are showing how to setup forwarding with local storage for respectively one and multiple target mailboxes. | |
− | + | === Failure setting forwarding to a single mailbox with local storage by setting the source address as the target address === | |
− | + | ||
− | === Failure | + | |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 146: | Line 146: | ||
</nowiki> | </nowiki> | ||
− | === Failure | + | === Failure setting forwarding to a single mailbox with local storage by providing a non-existing target === |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 165: | Line 165: | ||
</nowiki> | </nowiki> | ||
− | === Failure | + | === Failure setting forwarding to multiple mailboxes with local storage by providing a non-existing target === |
+ | It is important to know that either '''all or none''' of the targets will be set-up for forwarding.<br> | ||
+ | That is: a single non-existant mailbox in the targets list will prevent all of the targets from being added irrespective of it's position in the targets list. | ||
<nowiki> | <nowiki> | ||
POST accounts/{account}/email/test.com/usernames/test/forwards | POST accounts/{account}/email/test.com/usernames/test/forwards | ||
Line 184: | Line 186: | ||
</nowiki> | </nowiki> | ||
− | === Success | + | === Success setting forwarding to a single mailbox without local storage === |
− | Notice the '''different_domain | + | Notice the '''different_domain''' in the request.<br> |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
Line 192: | Line 194: | ||
{ | { | ||
"targets": [ | "targets": [ | ||
− | {"target": "test-fwd@ | + | {"target": "test-fwd@different_domain.com"} |
] | ] | ||
} | } | ||
Line 202: | Line 204: | ||
</nowiki> | </nowiki> | ||
− | === Success | + | === Success setting forwarding to multiple mailboxes without local storage === |
'''Request'''<br> | '''Request'''<br> | ||
− | Notice that '''different_domain_1.com''' and '''different_domain_2.com''' are both | + | Notice that '''different_domain_1.com''' and '''different_domain_2.com''' are both not test.com. |
<nowiki> | <nowiki> | ||
POST accounts/{account}/email/test.com/usernames/test/forwards | POST accounts/{account}/email/test.com/usernames/test/forwards | ||
Line 210: | Line 212: | ||
{ | { | ||
"targets": [ | "targets": [ | ||
− | {"target": "test-fwd@ | + | {"target": "test-fwd@different_domain_1.com"}, |
− | {"target": "test-fwd1@ | + | {"target": "test-fwd1@different_domain_2.com"} |
] | ] | ||
} | } |
Revision as of 23:58, 1 July 2014
POST accounts/{account}/email/{domain}/usernames/{mailbox}/forwards
Sets forwarding for specified mailbox,domain and account.
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
Setting forwarding with local storage
In order to have local storage for forwarding, target mailboxes have to be in the same local domain as the source mailbox.
So the previous two examples of successful setup of forwarding are showing how to setup forwarding with local storage for respectively one and multiple target mailboxes.
Failure setting forwarding to a single mailbox with local storage by setting the source address as the target address
Request
POST accounts/source_account/email/test.com/usernames/test/forwards { "targets": [ {"target": "source-account@test.com"} ] }
Response
400 Bad Request {"source-account@test.com": "Is the same as current mailbox"}
Failure setting forwarding to a single mailbox with local storage by providing a non-existing target
Request
POST accounts/{account}/email/test.com/usernames/test/forwards { "targets": [ {"target": "not-existing-mailbox@test.com"} ] }
Response
400 Bad Request {"not-existing-mailbox@test.com": "Target not found"}
Failure setting forwarding to multiple mailboxes with local storage by providing a non-existing target
It is important to know that either all or none of the targets will be set-up for forwarding.
That is: a single non-existant mailbox in the targets list will prevent all of the targets from being added irrespective of it's position in the targets list.
POST accounts/{account}/email/test.com/usernames/test/forwards { "targets": [ {"target": "existing-mailbox@test.com"}, {"target": "not-existing-mailbox@test.com"} ] }
Response
400 Bad Request {"not-existing-mailbox@test.com": "Target not found"}
Success setting forwarding to a single mailbox without local storage
Notice the different_domain in the request.
Request
POST accounts/{account}/email/test.com/usernames/test/forwards { "targets": [ {"target": "test-fwd@different_domain.com"} ] }
Response
204 No Content
Success setting forwarding to multiple mailboxes without local storage
Request
Notice that different_domain_1.com and different_domain_2.com are both not test.com.
POST accounts/{account}/email/test.com/usernames/test/forwards { "targets": [ {"target": "test-fwd@different_domain_1.com"}, {"target": "test-fwd1@different_domain_2.com"} ] }
Response
204 No Content
See also