文档首页> ISDP> API参考> API> 智能安监> 设备控制> 设备呼叫(API名称:openApiSendImMessage)
更新时间:2024-02-19 GMT+08:00
分享

设备呼叫(API名称:openApiSendImMessage)

功能介绍

用于与客户系统对接设备呼叫接口接口服务。

相关API

接口名称

调用说明

获取Token

调用该接口获取到Token,再调用其他接口时,需要在请求消息头中添加“Authorization”,其值即为Token。

URL

请求方式

HTTPS地址

服务架构

消息体类型

POST

https://isdp+域名/openapi/v1/openSendImMessage/openApiSendImMessage

OpenAPI

application/json

请求头

KEY

VALUE

是否必填

描述

Content-Type

application/json

Authorization

bearer ${access_token}

bearer +“ ”+5.2.1中获取的access_token的值

请求参数

参数

类型

是否必填

描述

message

String

根据需求有所变化,详情见下方请求示例

message参数说明

参数

类型

是否必填

描述

userId

long

应用管理中账号的userId

userName

String

应用管理中账号的userName

userNo

String

应用管理中账号的userNo

tenantId

int

租户id

deviceId

String

接受设备的设备id

isdpDeviceId

String

接受设备的isdpDeviceId

响应参数

参数

类型

描述

result

Object

响应消息体

errorMessage

String

接口错误时有值,正常调用时为空

stateCode

String

“0”成功 其他值失败

请求示例(呼叫设备例子)

:标红部分的是账号需要修改,759646@saasgroupchat.isdp-saas-sit.test.huawei.com为设备的chatJid;1663236474522是一个随机数UUID,http://isdp-saas-sit.test.huawei.com仅为sit示例,具体地址视现场openfire服务而定,后续标红账号见上表说明(蓝色部分是发送指令)。

{"message":"<?xml version=\"1.0\" encoding=\"UTF-8\" ?><message to=\"759646@saasgroupchat.isdp-saas-sit.test.huawei.com\" id=\"1663236474522\" type=\"chat\"><subject>qc-intellect-equip-remote-invite</subject><body>智能设备远端呼叫</body><properties xmlns=\"http://isdp-saas-sit.test.huawei.com/xmlns/xmpp/properties\"><content_type type=\"string\">text</content_type><nick type=\"string\" /><directives_type type=\"string\">qc-intellect-equip-remote-invite</directives_type><directives_attrs type=\"string\">{&quot;userId&quot;:864711,&quot;userName&quot;:&quot;zhang_sit&quot;,&quot;userNo&quot;:&quot;Zhang123456&quot;,&quot;tenantId&quot;:886,&quot;deviceId&quot;:&quot;aqm0523&quot;,&quot;isdpDeviceId&quot;:&quot;aqm0523--1&quot;}</directives_attrs></properties></message>"}

响应示例

{
    "stateCode": "0",
    "errorMessage": null,
    "result": null
}

状态码

状态码请参见状态码

错误码

错误码请参见错误码

分享:

    相关文档

    相关产品