消息通信相关 API

<p><strong><span style="font-size:16px">1. Publish</span></strong></p> <p><strong>描述</strong></p> <p>给设备发送消息。</p> <p><strong>请求参数</strong></p> <p><strong>&nbsp;</strong></p> <table border="1" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="vertical-align:top"> <p><strong>参数名称</strong></p> </td> <td style="vertical-align:top"> <p><strong>是否必须</strong></p> </td> <td style="vertical-align:top"> <p><strong>类型</strong></p> </td> <td style="vertical-align:top"> <p><strong>描述</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>Action</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>要执行的操作,取值:Publish。</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>productKey</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>产品key </strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>deviceName</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>设备名称</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>topicName</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>完整的消息主题</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>content</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>消息内容</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>qos</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>Integer</strong></p> </td> <td style="vertical-align:top"> <p><strong>目前只支持0最多送达一次,1至少送达一次</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>公共请求参数</strong></p> </td> <td style="vertical-align:top"> <p><strong>true</strong></p> </td> <td style="vertical-align:top"> <p><strong>&nbsp;</strong></p> </td> <td style="vertical-align:top"> <p><strong>请参见公共请求参数</strong></p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p><strong>返回参数</strong></p> <table border="1" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="vertical-align:top"> <p><strong>参数名称</strong></p> </td> <td style="vertical-align:top"> <p><strong>类型</strong></p> </td> <td style="vertical-align:top"> <p><strong>描述</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>RequestId</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>平安云为该请求生成的唯一标识符</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>Code</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>是否请求成功,success表示调用成功</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>Des</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>调用接口返回的描述信息</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>Message</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>返回操作状态,默认&ldquo;操作成功&rdquo;</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>Status</strong></p> </td> <td style="vertical-align:top"> <p><strong>Boolean</strong></p> </td> <td style="vertical-align:top"> <p><strong>调用接口是否成功,true表示调用成功,false表示调用失败</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>StatusCode</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>调用成功时返回SUCCESS,调用失败时返回错误码</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>ResultCode</strong></p> </td> <td style="vertical-align:top"> <p><strong>String</strong></p> </td> <td style="vertical-align:top"> <p><strong>返回操作状态码,默认&ldquo;A00000&rdquo;</strong></p> </td> </tr> <tr> <td style="vertical-align:top"> <p><strong>Content</strong></p> </td> <td style="vertical-align:top"> <p><strong>Data</strong></p> </td> <td style="vertical-align:top"> <p><strong>详情参见下表Content。</strong></p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p><strong>表Content</strong></p> <p>&nbsp;&nbsp;&nbsp; 无。</p> <p><strong>示例</strong></p> <p><strong>请求示例</strong></p> <p>https://api.yun.pingan.com/api/v1?action=Publish</p> <p>&amp;productKey=Oq4VM5xEpSJpqlfZWvE</p> <p>&amp;deviceName=dn1</p> <p>&amp;topicName=Oq4VM5xEpSJpqlfZWvE/dn1/control</p> <p>&amp;content=testetsset</p> <p>&amp;qos=0</p> <p>&amp;公共请求参数</p> <p><strong>返回示例</strong></p> <p>{</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Code&quot;:&quot;Success&quot;,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Content&quot;:{</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;SendStatus&quot;:&quot;SEND_OK&quot;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Desc&quot;:&quot;操作成功&quot;,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Message&quot;:&quot;操作成功。&quot;,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;RequestId&quot;:&quot;d9458a2018c32491&quot;,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;ResultCode&quot;:&quot;A00000&quot;,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Status&quot;:true,</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;StatusCode&quot;:&quot;SUCCESS&quot;</p> <p>}</p> <p>&nbsp;</p>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询 - 7x24 小时

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

7x24 小时,急速解答

工单支持

解决云产品相关技术问题