What Are the Possible Causes for an API Calling Failure?
Network
API calling failures may occur in three scenarios: within a VPC, between VPCs, and on a public network.
- Within a VPC: Check whether the domain name is the same as that automatically allocated for the API.
- Between VPCs: Check whether the two VPCs are connected. If they are not connected, create a VPC peering connection to connect the two VPCs.
For details about how to create and use VPC peering connections, see section "VPC Peering Connection" in the Virtual Private Cloud User Guide.
- On a public network:
- The API is not bound with an EIP and does not have a valid address for public network access.
Bind an EIP to the API and try again. For details, see Network Environment.
- The inbound rules are incorrectly configured.
For details about how to configure inbound rules, see Network Environment.
- The request header "host:Group domain name" is not added when you call the API. Add the request header and try again.
- The API is not bound with an EIP and does not have a valid address for public network access.
Domain Name
- Check whether the domain name bound to the API group to which the API belongs has been successfully licensed and can be resolved.
- Check whether the domain name has been bound to the correct API group.
- The subdomain name automatically allocated to the API group is accessed too many times. The subdomain name can be accessed only 1000 times a day. It is unique and cannot be modified. Add independent domain names for the group to make the APIs in the group accessible.
API Publishing
Check whether the API has been published. If the API has been modified, publish it again. If the API has been published to a non-RELEASE environment, specify the X-Stage header as the environment name.
API Authentication
If the API uses app authentication, check whether the AppKey and AppSecret used to call the API are correct.
API Control Policies
- Check whether the access control policy bound to the API is correct.
- Check whether the request throttling limit of the API has been reached. If no request throttling policy is created for an API, the API can be accessed 200 times per second by default. To change this limit, go to the Gateway Information page, click the Configuration Parameters tab, and modify the ratelimit_api_limits parameter.
API Calling FAQs
- What Are the Possible Causes for an API Calling Failure?
- What Should I Do If an Error Code Is Returned During API Calling?
- Why Am I Seeing the Error Message "414 Request-URI Too Large" When I Call an API?
- What Should I Do If "The API does not exist or has not been published in the environment." Is Displayed?
- Why Am I Seeing the Message "No backend available"?
- What Are the Possible Causes If the Message "Backend unavailable" or "Backend timeout" Is Displayed?
- Why Am I Seeing the Message "Backend domain name resolution failed" When a Backend Service Is Called?
- Why Doesn't Modification of the backend_timeout Parameter Take Effect?
- How Do I Switch the Environment for API Calling?
- What Is the Maximum Size of an API Request Package?
- How Do I Perform App Authentication in iOS System?
- Why Can't I Create a Header Parameter Named x-auth-token for an API Called Through IAM Authentication?
- App FAQs
- Can Mobile Apps Call APIs?
- Can Applications Deployed in a VPC Call APIs?
- How Do I Implement WebSocket Data Transmission?
- Does APIG Support Persistent Connections?
- How Will the Requests for an API with Multiple Backend Policies Be Matched and Executed?
- Is There a Limit on the Size of the Response to an API Request?
- How Can I Access Backend Services over Public Networks Through APIG?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more