文档中心 > API类目 > 智慧园区API

alibaba.iwork.mc.msg.sendmobile (发送消息给手机用户)

给手机用户发送对应操作结果的消息

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
mobile_receiver_message_event MobileReceiverMessageEvent 必须 消息对象
  • └ msg_key
  • String
  • 必须
  • 0bf7bbe7-b52f-4ee7-b4bf-6d4e110a6327
  • 消息key
  • └ event_time_millis
  • Number
  • 必须
  • 1505376496485
  • 时间戳
  • └ source
  • String
  • 必须
  • iwork
  • 来源
  • └ action
  • String
  • 必须
  • iwork-action
  • 消息事件
  • └ mobile_receiver
  • String
  • 必须
  • 13888888888
  • 接收人手机号
  • └ event_type
  • String
  • 必须
  • mobile_receiver
  • 消息类型
  • └ json_data
  • String
  • 必须
  • {"name":"张三"}
  • 消息内容
  • └ resource_id
  • String
  • 可选
  • 1
  • 资源ID
  • └ resource_url
  • String
  • 可选
  • http://www.aaa.com
  • 资源URL
  • └ sender
  • Number
  • 必须
  • 10000
  • 发送者

响应参数

名称 类型 示例值 描述
result PojoResult result
  • └ content
  • Boolean
  • true
  • content
  • └ error_code
  • String
  • 200
  • errorCode
  • └ error_msg
  • String
  • success
  • errorMsg
  • └ success
  • Boolean
  • true
  • success

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIworkMcMsgSendmobileRequest req = new AlibabaIworkMcMsgSendmobileRequest();
AlibabaIworkMcMsgSendmobileRequest.MobileReceiverMessageEvent obj1 = new AlibabaIworkMcMsgSendmobileRequest.MobileReceiverMessageEvent();
obj1.setMsgKey("0bf7bbe7-b52f-4ee7-b4bf-6d4e110a6327");
obj1.setEventTimeMillis(1505376496485L);
obj1.setSource("iwork");
obj1.setAction("iwork-action");
obj1.setMobileReceiver("13888888888");
obj1.setEventType("mobile_receiver");
obj1.setJsonData("{\"name\":\"张三\"}");
obj1.setResourceId("1");
obj1.setResourceUrl("http://www.aaa.com");
obj1.setSender(10000L);
req.setMobileReceiverMessageEvent(obj1);
AlibabaIworkMcMsgSendmobileResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_iwork_mc_msg_sendmobile_response>
    <result>
        <content>true</content>
        <error_code>200</error_code>
        <error_msg>success</error_msg>
        <success>true</success>
    </result>
</alibaba_iwork_mc_msg_sendmobile_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

返回
顶部