You can use an Alibaba Cloud software development kit (SDK), OpenAPI Explorer, Hypertext Transfer Protocol (HTTP) requests, or the generic calling method (CommonRequest) to call the Message Queue for Apache Kafka APIs.

Use CommonRequest

If Message Queue for Apache Kafka does not provide an SDK for its APIs, you can use CommonRequest to call any API. The Message Queue for Apache Kafka APIs are in the remote procedure call (RPC) style. These APIs can be called by using CommonRequest.

To use CommonRequest, you must obtain the values of the following parameters.
  • Domain: the region where the instance resides. For more information, see Endpoints.
  • Version: the version of the API. The version of the Message Queue for Apache Kafka APIs is 2019-09-16.
  • Action: the name of the operation to call. You need to obtain the value of the Action parameter and then run request.ApiName = "<Action>" to specify the API name. For example, to call the RunInstances operation, initiate a CommonRequest request with request.ApiName = "RunInstances". For more information, see List of operations by function.

Use an HTTP request

Send your HTTP request to the Message Queue for Apache Kafka endpoint. Add the request parameters required by the Message Queue for Apache Kafka operation that you want to call. After you call the operation, the system returns a response. Requests and responses for Message Queue for Apache Kafka APIs are encoded in UTF-8, which indicates that Message Queue for Apache Kafka APIs use the RPC protocol. You can make HTTP requests to call these APIs.

Request syntax:

http://Endpoint/?Action=xx&Parameters

The request includes the following parameters:

  • Endpoint: the endpoint of the Message Queue for Apache Kafka API. For more information, see Endpoints.
  • Action: the name of the operation that you want to perform. For example, to query all Message Queue for Apache Kafka instances, set the Action parameter to GetInstanceList.
  • Version: the version of the API. The version of the Message Queue for Apache Kafka APIs is 2019-09-16.
  • Parameters: the request parameters for the API operation. Separate multiple parameters with ampersands (&). Request parameters include both common request parameters and API operation-specific parameters. Common parameters include the API version and authentication information. For more information, see Common parameters.

Use an SDK

Message Queue for Apache Kafka provides SDKs in multiple programming languages. Message Queue for Apache Kafka SDKs can be used to automatically calculate the signature string. For more information, see Obtain an SDK.

Use OpenAPI Explorer

OpenAPI Explorer is a GUI tool for calling APIs. OpenAPI Explorer allows you to call APIs of Alibaba Cloud services and APIs provided in Alibaba Cloud API Marketplace. You can call these APIs on a web page or command-line interface (CLI). In addition, OpenAPI Explorer allows you to view the request and response of each API call and dynamically generates SDK sample code. Click the link to access OpenAPI Explorer.