You can call the CreateDomain operation to create a domain name.
Test
You can run this operation directly in OpenAPI Explorer. This saves you the trouble of calculating signatures. After a successful run, OpenAPI Explorer automatically generates SDK code examples.
Request parameters
Name | Type | Required | Example value | Description |
DomainName | String | Yes | example.com | The domain name. The domain name must be 1 to 50 characters in length and can contain digits, uppercase letters, lowercase letters, periods (.), and hyphens (-). |
AccessKeyId | String | No | xxxx | Your AccessKey ID. |
Action | String | No | CreateDomain | A required parameter. Set the value to CreateDomain. |
Response parameters
Name | Type | Example value | Description |
DomainId | String | 158910 | The domain ID. |
RequestId | String | B49AD828-25D1-488C-90B7-8853C1944486 | The request ID. |
Examples
Request example
http(s)://dm.aliyuncs.com/?Action=CreateDomain
&DomainName=example.com
&<Common request parameters>Response examples
XML format
<CreateDomainResponse>
<RequestId>B49AD828-25D1-488C-90B7-8853C1944486</RequestId>
<DomainId>158910</DomainId>
</CreateDomainResponse>JSON format
{
"RequestId":"B49AD828-25D1-488C-90B7-8853C1944486",
"DomainId":158910
}Error codes
Error code | Description | HTTP status code | Semantics |
InvalidDomainName.Duplicate | The specified domain name already exists. | 400 | The domain name already exists. |
InvalidDomainNumber.Malformed | The maximum number of domains is exceeded. | 400 | The number of domains exceeds the limit. |
InvalidDomainName.Malformed | The specified domain name is invalid. | 400 | The domain name format is invalid. |
InvalidDomainName.Conflict | The specified domain name is in use. | 400 | The specified domain name is used by another user. |
InvalidDomain.NotFound | The specified domain does not exist. | 404 | The specified domain name cannot be found. |
For more information about error codes, see the Error Center.