Accounts-account-email-domain-blackwhitelist:PUT
From Hostway API Documentation
(Difference between revisions)
(→Failure adding address with not valid address and type) |
Mike.robski (Talk | contribs) m (1 revision: Release 109) |
Latest revision as of 12:14, 24 July 2015
[edit] PUT /accounts/{account}/email/{domain}/blackwhitelist
Adding/updating addresses to black/white list for a specific domain
Contents |
[edit] Request
PUT /accounts/{account}/email/{domain}/blackwhitelist
[edit] URI Parameters
- account - string
- domain - string
[edit] 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
[edit] Request Body
{
"list":[
{
"address":"{address}",
"type":"{type}"
}
]
}
[edit] Parameters
- address - string
- Must be a valid email or domain address. Required.
- type - string
- One of W, B. Required.
[edit] Response
[edit] 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 does not exist.
[edit] Examples
[edit] Failure adding address with missing required parameter
Request
PUT /accounts/account-number/email/test.com/blackwhitelist
{"list":[{"address":"mb1-white@somedomain.com"}]}
Response
400 Bad Request
{
"badRequest": {
"message": "POST data error",
"code": 400,
"details": {
"list.0.type": "Required"
}
}
}
[edit] Failure adding address with not valid address and type
Request
PUT /accounts/account-number/email/test.com/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"
}
}
}
[edit] Success adding email addresses to blackwhitelist
Request
PUT /accounts/account-number/email/test.com/blackwhitelist
{"list":[{"address":"mb1-white20150114-0113@somedomain.com", "type":"W"}, {"address":"mb2-white20150114-0113@somedomain.com", "type":"W"}] }
Response
204 No Content
[edit] Success adding domain addresses to blackwhitelist
Request
PUT /accounts/account-number/email/test.com/blackwhitelist
{
"list": [
{
"type": "W",
"address": "@domainaddr1.com"
},
{
"type": "B",
"address": "@someotherdomain.com"
}
]
}