ApsaraMQ for MQTT APIs can be called over HTTP, through SDKs, or from OpenAPI Explorer.
HTTP calls
ApsaraMQ for MQTT provides RPC-style APIs that you call by sending HTTP GET requests.
The request structure is as follows:
http://Endpoint/?Action=xx&Parameters
Where:
-
Endpoint: The endpoint for ApsaraMQ for MQTT APIs is onsmqtt.[regionId].aliyuncs.com. For details about [regionId], see Service endpoints.
-
Action: The operation to perform. For example, call ApplyToken to request a token.
-
Version: The API version to use. The API version for ApsaraMQ for MQTT is 2020-04-20.
-
Parameters: The request parameters, separated by ampersands (&).
Request parameters include common parameters and API-specific parameters. Common parameters carry the API version and authentication information. For more information, see Common parameters.
SDK calls
Alibaba Cloud provides ApsaraMQ for MQTT SDKs in multiple languages that handle request signing automatically. For more information, see Obtain an OpenAPI SDK.
OpenAPI Explorer calls
OpenAPI Explorer lets you call APIs for Alibaba Cloud products and the API Marketplace from a webpage or the command line. You can view API requests and responses and generate sample SDK code.
You can go to OpenAPI Explorer to call APIs directly or use the debugging feature in the API documentation.
Service endpoints
The endpoint for ApsaraMQ for MQTT APIs is onsmqtt.[regionId].aliyuncs.com, where [regionId] is the ID of the region where your ApsaraMQ for MQTT instance resides.
The following table lists the supported OpenAPI regions with their region IDs and domain names.
|
Region Name |
Region ID |
Domain |
|
Public Network |
mq-internet-access |
onsmqtt.mq-internet-access.aliyuncs.com |
|
China (Chengdu) |
cn-chengdu |
onsmqtt.cn-chengdu.aliyuncs.com |
|
China (Hangzhou) |
cn-hangzhou |
onsmqtt.cn-hangzhou.aliyuncs.com |
|
China (Shanghai) |
cn-shanghai |
onsmqtt.cn-shanghai.aliyuncs.com |
|
China (Qingdao) |
cn-qingdao |
onsmqtt.cn-qingdao.aliyuncs.com |
|
China (Beijing) |
cn-beijing |
onsmqtt.cn-beijing.aliyuncs.com |
|
China (Zhangjiakou) |
cn-zhangjiakou |
onsmqtt.cn-zhangjiakou.aliyuncs.com |
|
China (Hohhot) |
cn-huhehaote |
onsmqtt.cn-huhehaote.aliyuncs.com |
|
China (Shenzhen) |
cn-shenzhen |
onsmqtt.cn-shenzhen.aliyuncs.com |
|
China (Hong Kong) |
cn-hongkong |
onsmqtt.cn-hongkong.aliyuncs.com |
|
Singapore |
ap-southeast-1 |
onsmqtt.ap-southeast-1.aliyuncs.com |
|
Malaysia (Kuala Lumpur) |
ap-southeast-3 |
onsmqtt.ap-southeast-3.aliyuncs.com |
|
Indonesia (Jakarta) |
ap-southeast-5 |
onsmqtt.ap-southeast-5.aliyuncs.com |
|
Japan (Tokyo) |
ap-northeast-1 |
onsmqtt.ap-northeast-1.aliyuncs.com |
|
Germany (Frankfurt) |
eu-central-1 |
onsmqtt.eu-central-1.aliyuncs.com |
|
US (Silicon Valley) |
us-west-1 |
onsmqtt.us-west-1.aliyuncs.com |
|
US (Virginia) |
us-east-1 |
onsmqtt.us-east-1.aliyuncs.com |
|
China East 1 Finance |
cn-hangzhou-finance |
onsmqtt.cn-hangzhou-finance.aliyuncs.com |
|
South China 1 Finance Cloud |
cn-shenzhen-finance-1 |
onsmqtt.cn-shenzhen-finance-1.aliyuncs.com |
|
East China 2 Finance Cloud |
cn-shanghai-finance-1 |
onsmqtt.cn-shanghai-finance-1.aliyuncs.com |
|
China (Beijing) Alibaba Gov Cloud 1 |
cn-north-2-gov-1 |
onsmqtt.cn-north-2-gov-1.aliyuncs.com |