Operation scenarios
After the service is successfully published, it can be tested by using the service's default subdomain name. If you want to publish the service for public access, please bind it to your own domain name for API access.
Note:
The default subdomain name provided by API Gateway is solely for integration testing and not recommended for use in your official production service. Once your testing is complete, we highly encourage you to utilise your own domain name. For more information, please refer to Binding A Custom Domain Name. After the binding, your API paths can be accessed via the custom domain name. Operation step
Default subdomain name rule of a service
The default subdomain name of the service appears automatically after a service is created, as shown in the figure below.
Each service in API Gateway provides a default subdomain name, containing the following rules:
First type: From November 22, 2023, a brand new subdomain name will be officially put into use
http://{service-id}-{your-unique-id}.{region}.tencentapigw.com
Second type: Users utilizing this domain name will gradually use the new domain name tencentapigw.com
http://{service-id}-{your-unique-id}.{region}.apigw.tencentcs.com
Third type: service only appeared before 2021
http://{your-unique-id}.{region}.apigateway.myqcloud.com
API path access rules of a service
The API path is a custom-defined part of the front-end access path when a user creates an API. Once the API creation is complete, it can be viewed in the following positions.
The following section provides an example using the aforementioned first type of default sub-domain name:
After a service is published, the access path to the specific API is as follows
When there is only an environment for a service, the three supported environments are distinguished as follows:
Release Environment http://{your-unique-id}.{region}.tencentapigw.com/release
.
Prerelease Environment http://{your-unique-id}.{region}.tencentapigw.com/prepub
.
Test Environment http://{your-unique-id}.{region}.tencentapigw.com/test
.
When there is an environment and API path for a service, an environment should be designated first, followed by the path:
For instance, to access the /getUser path in the release environment, use http://{your-unique-id}.{region}.tencentapigw.com/release/getUser
.
Example
Your user ID is 123456789. You have created a service named register
in Guangzhou (gz), which has a service ID of service-n904iiau. You have also added an API with a path of /user
. The register
service is now published on 3 different environments
. Under these circumstances, if other users, applications or terminals require access to the /user
API, the accurate access path are as follows:
Release environment: http://service-n904iiau-123456789.gz.tencentapigw.com/release/user
.
Pre-release environment: http://service-n904iiau-123456789.gz.tencentapigw.com/prepub/user
.
Test environment: http://service-n904iiau-123456789.gz.tencentapigw.com/test/user
.
Note
Due to the quality issues of international links, which are impacted by various factors and hard for the ISP to optimize and improve over a short period, there might be instances of packet loss or timeouts during cross-border access with API Gateway. If you mainly access overseas businesses, we suggest you respectively create resources domestically and overseas. The domestic services cover local businesses, and overseas services cover foreign businesses. So you can avoid congested cross-border network segments for a better business experience. We appreciate your understanding and support.
Was this page helpful?