Description
This function is for binding a custom domain name to a specified API group.
- This function is intended for API providers.
- Requests can be sent to your backend services only after an independent domain name is filed successfully in Alibaba Cloud system. Filing and access processes
- You must resolve the CNAME of the independent domain name to the group’s second-level domain name, and then bind the independent domain name to the group. Otherwise, the system returns an error during the binding operation.
- To bind an independent domain name of another group to the current group, you must change the resolution of the independent domain name and then bind it to the current group.
- If the HTTPS protocol is used, you must upload the SSL certificate subsequently. For more information, see SetDomainCertificate.
Request parameters
Name | Type | Required? | Description |
---|---|---|---|
Action | String | Yes | Interface name, which is a required parameter; value: SetDomain. |
GroupId | String | Yes | API group ID, which is generated by the system and globally unique. |
DomainName | String | Yes | Custom domain name. |
Returned parameters
Name | Type | Description |
---|---|---|
RequestId | String | Unique request ID. |
GroupID | String | API group ID, which is generated by the system and globally unique. |
DomainName | String | Custom domain name. |
SubDomain | String | Second-level domain name bound to the API group, which is used for API call testing. |
DomainBindingStatus | String | Binding status of the custom domain name.
|
DomainLegalStatus | String | Domain legal status; values:
|
DomainRemark | String | Remark of the domain, such as the reason for abnormity. |
Examples
Request example
https://apigateway.cn-hangzhou.aliyuncs.com/?Action=SetDomain
&GroupId=927d50c0f2e54b359919923d908bb015
&DomainName=api.demo.com
&<Public request parameters>
Response example
XML
format
<SetDomainResponse>
<RequestId>6EF60BEC-0242-43AF-BB20-270359FB54A7</RequestId>
<GroupId>927d50c0f2e54b359919923d908bb015</GroupId>
<DomainName>api.demo.com</DomainName>
<SubDomain>927d50c0f2e54b359919923d908bb015-cn-hangzhou.alicloudapi.com</SubDomain>
<DomainBindingStatus>BINDING</DomainBindingStatus>
<DomainLegalStatus>NORMAL</DomainLegalStatus>
<DomainRemark></DomainRemark>
</SetDomainResponse>
JSON
format
{
"RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
"GroupId": "927d50c0f2e54b359919923d908bb015",
"DomainName": "api.abcdef.com",
"SubDomain": "927d50c0f2e54b359919923d908bb015-cn-hangzhou.alicloudapi.com",
"DomainBindingStatus": "BINDING",
"DomainLegalStatus":"NORMAL",
"DomainRemark":""
}