Accounts-accountNumber-web-domainName-subdomains:POST
From Hostway API Documentation
(Difference between revisions)
(→POST /accounts/{accountNumber}/web/{domainName}/subdomains) |
Mike.robski (Talk | contribs) m (1 revision: Release 109) |
Latest revision as of 12:16, 24 July 2015
POST /accounts/{accountNumber}/web/{domainName}/subdomains
Creates subdomain.
Contents |
Request
POST /accounts/{accountNumber}/web/{domainName}/subdomains
URI Parameters
- accountNumber - string
- The user account to which the domain name and the subdomain 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
{ "subdomain": "{subdomain}" }
Parameters
- subdomain - string
- A valid subdomain. Required.
Response
Status Code
- 202 Accepted
- Success
- 400 Bad Request
- The format of the request body is invalid or the subdomain 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 sub domain already exists(on create) or domain is disabled(on update).
Examples
Failure creating a subdomain when required parameter is missing
Request
POST /accounts/test-account/email/test.com/subdomains {"subdomain": ""}
Response
400 Bad Request {"badRequest": {"guid": "", "message": "POST data error", "code": 400, "details": {"subdomain": "Required"}}}
Failure creating a subdomain when passing invalid parameter
Request
POST /accounts/test-account/email/test.com/subdomains {"subdomain": "subtest4-subtest4-subtest4-subtest4-subtest4-subtest4-subtest4ab"}
Response
400 Bad Request {"badRequest": {"guid": "", "message": "POST data error", "code": 400, "details": {"subdomain": "Invalid subdomain name: subtest4-subtest4-subtest4-subtest4-subtest4-subtest4-subtest4ab"}}}
Successfully creating a subdomain
Request
POST /accounts/test-account/email/test.com/subdomains {"subdomain": "sub"}
Response
202 Accepted { "links": [{"href": "https://api.hostway.com/accounts/test-account/web/test.dom/subdomains/", "rel": "self"}, {"href": "https://api.hostway.com/orders/123/action/", "rel": "submit"}, {"href": "https://api.hostway.com/orders/123/quote/", "rel": "quote"}] }
Request
POST /orders/123/action {"action": "submit"}
Response
202 Accepted