Updated on 2022-02-21 GMT+08:00

Binding a Domain Name

Scenario

Before you open an API, you must bind one or more independent domain names to the group to which the API belongs. If no domain names are bound to the group, the API will be called using the default subdomain name of the group and can be called only 1000 times a day.

You can bind a maximum of five independent domain names to an API group.

Note the following points before you bind a domain name:

  • Subdomain name: After an API group is created, the system automatically allocates a unique subdomain name to it for internal testing. The subdomain name can be accessed 1000 times a day, but it cannot be modified.
  • Independent domain name: An independent domain name is a custom domain name used for API callers to call open APIs in the group to which the domain name is bound.

Prerequisites

  1. There is an independent domain name available.
  2. A CNAME record points the independent domain name to the subdomain name of the API group. For details, see chapter "Managing Record Sets" in the Domain Name Service User Guide.
  3. If the API group contains APIs that are called through HTTPS, there needs to be SSL certificates configured for the independent domain name. SSL certificates can only be added manually with a custom name, content, and a key.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and choose API Gateway.
  3. In the navigation pane, choose API Publishing > API Groups.
  4. Go to the Domain Names tab page using one of the following methods:

    • Click the name of the target API group, and click the Domain Names tab on the displayed API group details page.
    • In the Operation column of the target API group, choose More > Manage Domain Name.

  5. Click Bind Independent Domain Name and enter a domain name.
  6. Click OK.

    If the domain name is not needed, click Unbind to unbind it from the API group.

  7. (Optional) If the API group contains APIs that are accessed through HTTPS, add an SSL certificate.

    1. Click Add SSL Certificate.
    2. Enter the name, content, and key of the obtained SSL certificate, and click OK.
    • Currently, you can only add SSL certificates in the PEM format. To add SSL certificates of other formats, convert the certificates into the PEM format first.
    • To edit an SSL certificate, click next to the certificate name. The certificate content and key will not be visible after you click OK to add the certificate. If the content has been updated, add the entire content or key again.
    • If you do not require an SSL certificate, click Delete SSL Certificate in the row containing the certificate to delete it.

Troubleshooting

  • Failure in binding an independent domain name: The independent domain name is not CNAMEd to the subdomain name of the API group, or the independent domain name already exists.
  • Failure in adding an SSL certificate: The domain name of the SSL certificate is different from the domain name for which you add the SSL certificate.

Follow-Up Operations

After binding independent domain names to the API group, create APIs in the group to selectively expose backend capabilities. For details, see Creating an API.