文档中心 > API类目 > 天猫精灵开放API

alibaba.ailabs.iot.device.mesh.event.invoke (弹内设备中心事件调用)

弹内设备中心事件调用

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
trace_id String 必须 2107f1ec16473961102317043d06de 链接id
user_type String 必须 ali_genie 用户类型
event LivingGenericEventDTO 必须 事件
  • └ payload
  • String
  • 必须
  • {}
  • 事件内容
  • └ namespace
  • String
  • 必须
  • AliGenie.SmartHome
  • 事件命名空间
  • └ name
  • String
  • 必须
  • DeviceRegisger
  • 命名
server_event_request_id String 必须 123123123 事件服务请求id
uuid String 必须 2132313 音箱uuid
user_id Number 必须 1231321 用户

响应参数

名称 类型 示例值 描述
trace_id String 2107f1ec16473961102317043d06de 事件链路id
result Boolean true 成功还是失败
ret_value String 123 响应值
ret_code Number 123 错误码
message String "error" 错误描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAilabsIotDeviceMeshEventInvokeRequest req = new AlibabaAilabsIotDeviceMeshEventInvokeRequest();
req.setTraceId("2107f1ec16473961102317043d06de");
req.setUserType("ali_genie");
AlibabaAilabsIotDeviceMeshEventInvokeRequest.LivingGenericEventDTO obj1 = new AlibabaAilabsIotDeviceMeshEventInvokeRequest.LivingGenericEventDTO();
obj1.setPayload("{}");
obj1.setNamespace("AliGenie.SmartHome");
obj1.setName("DeviceRegisger");
req.setEvent(obj1);
req.setServerEventRequestId("123123123");
req.setUuid("2132313");
req.setUserId(1231321L);
AlibabaAilabsIotDeviceMeshEventInvokeResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_ailabs_iot_device_mesh_event_invoke_response>
    <trace_id>2107f1ec16473961102317043d06de</trace_id>
    <result>true</result>
    <ret_value>123</ret_value>
    <ret_code>123</ret_code>
    <message>&quot;error&quot;</message>
</alibaba_ailabs_iot_device_mesh_event_invoke_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部