The Elastic IP Address (EIP) API and Virtual Private Cloud (VPC) API share the same endpoint. To call the EIP API, you must send HTTP GET requests to the endpoint of the EIP API. You must add the request parameters that correspond to the API operation being called. After you call the API, the system returns a response. The request and response are both encoded in UTF-8.

Request syntax

EIP API operations use the RPC protocol. You can call EIP API operations by sending HTTP GET requests.

The request syntax is:
  • Endpoint: the endpoint of the EIP API. The endpoint is
  • Action: the name of the operation being performed. For example, to create an EIP, you must set the Action parameter to AllocateEipAddress.
  • Version: the version of the API that you want to call. The current EIP API version is 2016-04-28.
  • Parameters: the request parameters for the operation. Separate multiple parameters with ampersands (&).

    Request parameters include common parameters and operation-specific parameters. Common parameters include information such as the API version number and authentication information. For more information, see Common parameters.

The following is an example of calling the AllocateEipAddress operation to apply for an EIP:
Note The following code has been edited to improve readability.


To ensure the security of your account, we recommend that you call EIP API operations as a RAM user. To call the EIP API as a RAM user, you must create a permission policy that contains the required permissions and attach the policy to the RAM user.

For more information about the EIP resources and API operations that can be authorized to a RAM user, see RAM authentication.


You must sign all API requests to ensure security. Apsara Stack uses the request signature to verify the identity of the API caller.

EIP implements symmetric encryption with an AccessKey pair to verify the identity of the request sender. An AccessKey pair is an identity credential issued to Alibaba Cloud accounts and RAM users. An AccessKey pair is similar to a pair of username and password. The AccessKey ID is used to verify the identities of the API callers. The AccessKey secret is a secret key that is used to encrypt the signature string on a client and verify the signature string on a server. It is used to authenticate users and must be kept confidential.

To call an RPC API operation, you must add the signature to the API request in the following format:


Take AllocateEipAddress as an example. The AccessKey ID is testid and the AccessKey secret is testsecret. The URL before the request is signed is:
Perform the following operations to calculate the signature:
  1. Use the request parameters to create a string-to-sign.
  2. Calculate the HMAC value of the string to be signed.

    Append an ampersand (&) to the AccessKey secret as the key to calculate the HMAC value. In this example, the key is testsecret&.

  3. Add the signature to the request parameters.