Accounts-accountNumber-web-domainName-aliases:POST

From Hostway API Documentation
Jump to: navigation, search

POST /accounts/{accountNumber}/web/{domainName}/aliases

Creates domain name alias.

Contents


Request

GET /accounts/{accountNumber}/web/{domainName}/aliases

URI Parameters

accountNumber - string
The user account to which the domain name and the domain name alias belong
domainName - string
The target domain name (domain name under which the site is actually hosted)

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.

Request Body

{
    "alias": "{alias}"
}
 

Parameters

alias - string
A valid domain name. Required.

Response

Status Code

202 Accepted
Success
400 Bad Request
The format of the request body is invalid or the alias 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.
409 Conflict
The alias already exists(on create) or domain is disabled(on update).

Examples

Failure creating a domain alias when required parameter is missing

Request

POST /accounts/test-account/email/test.com/aliases

{"alias": ""}
 

Response

400 Bad Request

{"badRequest": {"guid": "", "message": "POST data error", "code": 400, "details": {"alias": "Required"}}}

 

Failure creating a domain alias when passing invalid parameter

Request

POST /accounts/test-account/email/test.com/aliases

{"alias": "alias"}
 

Response

400 Bad Request

{"badRequest": {"guid": "", "message": "POST data error", "code": 400, "details": {"alias": "Invalid domain name in alias: test"}}}

 

Successfully creating a domain alias

Request

POST /accounts/test-account/email/test.com/aliases

{"alias": "alias.com"}
 

Response

202 Accepted

 

blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox