SubscribeTopic_物联网平台_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

使用说明

  • 待订阅 Topic 所属设备,必须已经接入物联网平台并激活在线。
  • 调用本接口仅订阅指定设备的 Topic,且单次调用最多订阅 10 个 Topic。

QPS 限制

单个阿里云账号调用该接口的每秒请求数(QPS)最大限制为 10。

说明 RAM 用户共享阿里云账号配额。

流控信息

当前云产品API请求速率暂未透出。

授权信息

当前云产品暂无权限信息透出。

请求参数

字段名称字段详情
IotInstanceIdstring

实例 ID。您可在物联网平台控制台的实例概览页面,查看当前实例的 ID展开详情

示例值:iot-06***
ProductKeystring

设备所属产品的 ProductKey

示例值:a1Q5XoY***参考取值来源:
    CreateProduct
    QueryProductList
    ReleaseProduct
    ListProductByTags
    BindLicenseProduct
    BatchBindProductsIntoProject
DeviceNamestring

指定要订阅 Topic 所属设备的 DeviceName

示例值:device1
Topicarray<string>

要订阅的 Topic,最多订阅 10 个 Topic。展开详情

示例值:/a1Q5XoY***/device1/user/get子级条数 <= 10

请求说明

调用 API 时,除了本文介绍的该 API 的特有请求参数,还需传入公共请求参数。公共请求参数说明,请参见公共参数文档

返回参数

字段名称字段详情
Codestring

调用失败时,返回的错误码。更多信息,请参见错误码

示例值:iot.system.SystemException
ErrorMessagestring

调用失败时,返回的出错信息。

示例值:系统异常
RequestIdstring

阿里云为该请求生成的唯一标识符。

示例值:BB71E443-4447-4024-A000-EDE09922891E
Successboolean

表示是否调用成功。展开详情

示例值:true

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
Iot.System.BillIsOverDue
Your account has overdue payments. Go to the expense center and add funds to your account.诊断
400
Iot.MessageBroker.EmptySubTopicList
The subscription topic list is empty.诊断
400
Iot.Device.NotExistedDevice
The device does not exist.诊断
400
Iot.MessageBroker.TopicTemplateIsNotFound
The topic template does not exist.诊断
400
iot.prod.NotExistedProduct
The specified product does not exist.诊断
400
iot.device.InactiveDevice
The device is inactive.诊断
400
Iot.MessageBroker.InvalidFormattedTopicName
The topic format specified while publishing the message is incorrect.诊断
403
Iot.Device.NotDeviceOwner
You are not the device owner.诊断
500
Iot.MessageBroker.BatchSubTopicFailed
An error occurred while batch subscribing to the topic.诊断

变更历史

暂无变更历史