edit-icon download-icon

Set service endpoints

Last Updated: Mar 20, 2018

When using the Alibaba Cloud Python SDK to call APIs, the service endpoint for each API is required. You must first specify the region ID used for accessing Alibaba Cloud services in AcsClient as shown. Then, the system returns the service endpoint according to the region ID and the product name. Click here to obtain region IDs.

  1. client = AcsClient(
  2. "<your-access-key-id>",
  3. "<your-access-key-secret>",
  4. "<your-region-id>"
  5. );

Substitute the values for your-access-key-id, your-access-key-secret, and your-region-id.

Note: The order of the parameters cannot be changed. The last parameter must be your-region-id.

Troubleshoot

If an SDK.InvalidRegionId or Can not find endpoint to access error occurs when initializing the client, you can troubleshoot the error as follows:

  • Cause: The cloud service that you use is not available in the specified region or the service does not have an endpoint.

    Resolution: Open a ticket to register an endpoint.

  • Cause: Incorrect parameter values.

    Resolution: Check the parameter values and make sure the sequence of the parameters is correct.

Thank you! We've received your feedback.