Updated on 2022-09-08 GMT+08:00

Overview

This document describes how to call cloud service APIs that have been registered with API Gateway, through AK/SK authentication. It explains the signing process and implementation logic, and provides signature SDKs and invocation examples of different programming languages, such as Java, Go, Python, and C.

  1. For the authentication of certain cloud service APIs that are not registered with API Gateway, see the API Reference of the corresponding service.

    The API Reference contains a section named "Calling APIs" that describes API authentication methods.

  2. The SDK of each programming language is packaged in the sample code and can be obtained separately. You can integrate the SDK into your application by referring to the API calling example.
  3. If you cannot find any signing example of the programming language you use in this document, please sign requests by referring to AK/SK Authentication.
  4. Alternatively, you can call APIs using a token. For details about the use of a token, see the API Reference of the relevant service.
  5. AK/SK authentication supports API requests with a body less than or equal to 12 MB. For API requests with a larger body, token authentication is recommended.
  6. For the APIs provided by a cloud service, see the API Reference of the cloud service.
  7. The local time on the client must be synchronized with the clock server to avoid a large offset in the value of the X-Sdk-Date request header.

    API Gateway checks the time format and compares the time in the header with the time when API Gateway receives the request. If the time difference exceeds 15 minutes, API Gateway will reject the request.