ApsaraMQ for MQTT You can call the API by using HTTP, SDK, or OpenAPI Explorer.

Call API operations by using HTTP

ApsaraMQ for MQTT The API for RPC is in RPC style. You can call ApsaraMQ for MQTT API.

The request structure is as follows:
http://Endpoint/?Action=xx&Parameters
Where
  • Endpoint: ApsaraMQ for MQTT the service access address of [******] is onsmqtt.[regionId].aliyuncs.com.[ regionId], see Endpoint.
  • Action: the name of the operation being performed. For example, to apply for a token, you must set the Action parameter to ApplyToken.
  • Version: The version of the API to use, ApsaraMQ for MQTT the API version of IS 2020-04-20.
  • Parameters: the request parameters for the operation. Separate multiple parameters with ampersands (&).

    Request parameters include both common parameters and operation-specific parameters. Common request parameters include the API version and authentication-related parameters. For more information, see Common parameters.

Call API operations by using SDKs

The ApsaraMQ for MQTT API supports SDKs for multiple programming languages. The SDKs automatically sign requests for you. For more information, see Obtain SDKs for the ApsaraMQ for MQTT API.

Call API operations by using OpenAPI Explorer

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

You can call API operations by directly accessing OpenAPI Explorer or using debugging features in the API documentation.

Endpoint

ApsaraMQ for MQTT The API access address for is as follows: onsmqtt.[regionId].aliyuncs.com. [regionId] is the ID of the region where the ApsaraMQ for MQTT instance is located.

ApsaraMQ for MQTT Supported OpenAPI regions, and the corresponding regionId and domain as shown in the following table.

RegionRegion IDDomain
Internetmq-internet-accessonsmqtt.mq-internet-access.aliyuncs.com
China (Chengdu)cn-chengduonsmqtt.cn-chengdu.aliyuncs.com
China (Hangzhou)cn-hangzhouonsmqtt.cn-hangzhou.aliyuncs.com
China (Shanghai)cn-shanghaionsmqtt.cn-shanghai.aliyuncs.com
China (Qingdao)cn-qingdaoonsmqtt.cn-qingdao.aliyuncs.com
China (Beijing)cn-beijingonsmqtt.cn-beijing.aliyuncs.com
China (Zhangjiakou)cn-zhangjiakouonsmqtt.cn-zhangjiakou.aliyuncs.com
China (Hohhot)cn-huhehaoteonsmqtt.cn-huhehaote.aliyuncs.com
China (Shenzhen)cn-shenzhenonsmqtt.cn-shenzhen.aliyuncs.com
China (Hong Kong)cn-hongkongonsmqtt.cn-hongkong.aliyuncs.com
India (Mumbai)ap-south-1onsmqtt.ap-south-1.aliyuncs.com
Singaporeap-southeast-1onsmqtt.ap-southeast-1.aliyuncs.com
Australia (Sydney)ap-southeast-2onsmqtt.ap-southeast-2.aliyuncs.com
Malaysia (Kuala Lumpur)ap-southeast-3onsmqtt.ap-southeast-3.aliyuncs.com
Indonesia (Jakarta)ap-southeast-5onsmqtt.ap-southeast-5.aliyuncs.com
Japan (Tokyo)ap-northeast-1onsmqtt.ap-northeast-1.aliyuncs.com
Germany (Frankfurt)eu-central-1onsmqtt.eu-central-1.aliyuncs.com
US (Silicon Valley)us-west-1onsmqtt.us-west-1.aliyuncs.com
US (Virginia)us-east-1onsmqtt.us-east-1.aliyuncs.com
East China 1 Financecn-hangzhou-financeonsmqtt.cn-hangzhou-finance.aliyuncs.com
South China 1 Financecn-shenzhen-finance-1onsmqtt.cn-shenzhen-finance-1.aliyuncs.com
China East 2 Financecn-shanghai-finance-1onsmqtt.cn-shanghai-finance-1.aliyuncs.com
China North 2 Ali Govcn-north-2-gov-1onsmqtt.cn-north-2-gov-1.aliyuncs.com