When you call an API, the system sends an HTTP request to the endpoint and adds the request parameters in the request based on the operation description. After the operation is called, the system returns the result. The request and response are encoded in UTF-8.

Endpoints

Message Queue for MQTTThe API access address for is as follows: onsmqtt.[regionId].aliyuncs.com. Where, [regionId] for Message Queue for MQTTthe region ID of the instance.

Message Queue for MQTTThe following table lists supported regions and the corresponding region IDs and domains.

Region regionId domain
Internet mq-internet-access ons.mq-internet-access.aliyuncs.com
China (Hangzhou) cn-hangzhou ons.cn-hangzhou.aliyuncs.com
China (Shanghai) cn-shanghai ons.cn-shanghai.aliyuncs.com
China (Qingdao) cn-qingdao ons.cn-qingdao.aliyuncs.com
China (Beijing) cn-beijing ons.cn-beijing.aliyuncs.com
China (Zhangjiakou-Beijing Winter Olympics) cn-zhangjiakou ons.cn-zhangjiakou.aliyuncs.com
China (Hohhot) cn-huhehaote ons.cn-huhehaote.aliyuncs.com
China (Shenzhen) cn-shenzhen ons.cn-shenzhen.aliyuncs.com
China (Hong Kong) cn-hongkong ons.cn-hongkong.aliyuncs.com
Singapore ap-southeast-1 ons.ap-southeast-1.aliyuncs.com
Australia (Sydney) ap-southeast-2 ons.ap-southeast-2.aliyuncs.com
Malaysia (Kuala Lumpur) ap-southeast-3 ons.ap-southeast-3.aliyuncs.com
Indonesia (Jakarta) ap-southeast-5 ons.ap-southeast-5.aliyuncs.com
Japan (Tokyo) ap-northeast-1 ons.ap-northeast-1.aliyuncs.com
Germany (Frankfurt) eu-central-1 ons.eu-central-1.aliyuncs.com
US (Silicon Valley) us-west-1 ons.us-west-1.aliyuncs.com
East China 1 Finance cn-hangzhou-finance ons.cn-hangzhou-finance.aliyuncs.com
South China 1 Finance cn-shenzhen-finance-1 ons.cn-shenzhen-finance-1.aliyuncs.com
China East 2 Finance cn-shanghai-finance-1 ons.cn-shanghai-finance-1.aliyuncs.com
China North 2 Ali Gov cn-north-2-gov-1 ons.cn-north-2-gov-1.aliyuncs.com

Communications protocol

You can send API requests over HTTP or HTTPS. We recommend that you send requests over HTTPS for enhanced security.

Request syntax

Message Queue for MQTTA RESTful API is provided for you. The request structure is as follows:

HTTPMethod /resource_URI_parameters
RequestHeader
RequestBody
Edit the code as follows:
  • HTTPMethod: the method of the request, including PUT and GET.
  • resource_URI_parameters: the uniform identifier of the resource to call, for example, /cluster.
  • RquestHeader: The request header, which usually contains information such as the API version, Host, and Authorization. For more information, see Common request and response headers.

    Request parameters consists of the common request header and custom API parameters. Common request headers contain information such as the API version and authentication information.

  • RequestBody: the request parameters.

Example

http:// xxxxx&<common request parameters>
{
  "AppName","app1",
  "AppDescription","This is an application",
  "CategoryName","Java",
}

Request encoding

Requests and responses are encoded using UTF-8.