Accounts-account-email-domain-usernames-mailboxName-blackwhitelist:PUT
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 103) |
(→Success adding mailbox addresses to blackwhitelist) |
||
Line 35: | Line 35: | ||
==== Parameters ==== | ==== Parameters ==== | ||
; address - ''string'' | ; address - ''string'' | ||
− | : Must be a valid email address. Required. | + | : Must be a valid email or domain address. Required. |
; type - ''string'' | ; type - ''string'' | ||
: One of W, B. Required. | : One of W, B. Required. | ||
− | |||
== Response == | == Response == | ||
Line 100: | Line 99: | ||
"details": { | "details": { | ||
"list.0.type": "\"A\" is not one of B, W", | "list.0.type": "\"A\" is not one of B, W", | ||
− | "list.0.address": "Invalid | + | "list.0.address": "Invalid address format: somedomain.com" |
} | } | ||
} | } | ||
Line 106: | Line 105: | ||
</nowiki> | </nowiki> | ||
− | === Success adding addresses to | + | === Success adding mailbox addresses to blackwhitelist === |
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist | PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist | ||
− | {"list":[{"address":"mb1- | + | { |
+ | "list":[ | ||
+ | { | ||
+ | "address":"mb1-white@somedomain.com", | ||
+ | "type":"W" | ||
+ | }, | ||
+ | { | ||
+ | "address":"mb2-white@somedomain.com", | ||
+ | "type":"W" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
</nowiki> | </nowiki> | ||
Line 117: | Line 127: | ||
<nowiki> | <nowiki> | ||
204 No Content | 204 No Content | ||
+ | </nowiki> | ||
+ | |||
+ | === Success adding domain addresses to blackwhitelist === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist | ||
+ | |||
+ | { | ||
+ | "list": [ | ||
+ | { | ||
+ | "type": "W", | ||
+ | "address": "@domainaddr1.com" | ||
+ | }, | ||
+ | { | ||
+ | "type": "B", | ||
+ | "address": "@someotherdomain.com" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
</nowiki> | </nowiki> | ||
Revision as of 07:11, 16 April 2015
PUT /accounts/{account}/email/{domain}/usernames/{mailbox}/blackwhitelist
Adding/updating addresses to black/white list for a specific mailbox
Contents |
Request
PUT /accounts/{account}/email/{domain}/usernames/{mailbox}/blackwhitelist
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
{ "list":[ { "address":"{address}", "type":"{type}" } ] }
Parameters
- address - string
- Must be a valid email or domain address. Required.
- type - string
- One of W, B. Required.
Response
Status Code
- 204 No Content
- Success
- 400 Bad Request
- The format of the request body is invalid or the address 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 or the mailbox does not exist.
Examples
Failure adding address with missing required parameter
Request
PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist {"list":[{"address":"mb1-white@somedomain.com"}]}
Response
400 Bad Request { "badRequest": { "message": "POST data error", "code": 400, "details": { "list.0.type": "Required" } } }
Failure adding address with not valid address and type
Request
PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist {"list":[{"address":"somedomain.com","type":"A"}]}
Response
400 Bad Request { "badRequest": { "message": "POST data error", "code": 400, "details": { "list.0.type": "\"A\" is not one of B, W", "list.0.address": "Invalid address format: somedomain.com" } } }
Success adding mailbox addresses to blackwhitelist
Request
PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist { "list":[ { "address":"mb1-white@somedomain.com", "type":"W" }, { "address":"mb2-white@somedomain.com", "type":"W" } ] }
Response
204 No Content
Success adding domain addresses to blackwhitelist
Request
PUT /accounts/account-number/email/test.com/usernames/test/blackwhitelist { "list": [ { "type": "W", "address": "@domainaddr1.com" }, { "type": "B", "address": "@someotherdomain.com" } ] }