发送小程序

请求URL:

  • http://域名地址/sendApp

请求方式:

  • POST

请求头Headers:

  • Content-Type:application/json
  • Authorization:login接口返回

参数:

参数名 必选 类型 说明
wId string 登录实例标识
wcId string 接收方微信id/群id
content string 小程序xml内容, (小程序xml需先收集入库,也就是说将想要发送的小程序手动发送给机器人微信,此时消息回调中获取xml内容,xml去掉部分仅截取appmsg开头的,具体请看请求参数示例,且xml中可以自定义任意参数,例如:封面图、携带参数的跳转地址等,封面图需先调用cdn图片上传接口获取相应加密key并替换)

返回数据:

参数名 类型 说明
code string 1000成功,1001失败
msg string 反馈信息
data
data.type int 类型
data.msgId long 消息msgId
data.newMsgId long 消息newMsgId
data.createTime long 消息发送时间戳
data.wcId string 消息接收方id

请求参数示例

{

    "wId": "0000016f-78bd-21c8-0001-29c4d004ae46",
     "wcId": "jack_623555049",
    "content": "<appmsg appid=\"\" sdkver=\"0\">\n\t\t<title>拼多多商城</title>\n\t\t<des>拼多多</des>\n\t\t<action />\n\t\t<type>33</type>\n\t\t<showtype>0</showtype>\n\t\t<soundtype>0</soundtype>\n\t\t<mediatagname />\n\t\t<messageext />\n\t\t<messageaction />\n\t\t<content />\n\t\t<contentattr>0</contentattr>\n\t\t<url>https://mp.weixin.qq.com/mp/waerrpage?appid=wx32540bd863b27570&amp;type=upgrade&amp;upgradetype=3#wechat_redirect</url>\n\t\t<lowurl />\n\t\t<dataurl />\n\t\t<lowdataurl />\n\t\t<songalbumurl />\n\t\t<songlyric />\n\t\t<appattach>\n\t\t\t<totallen>0</totallen>\n\t\t\t<attachid />\n\t\t\t<emoticonmd5></emoticonmd5>\n\t\t\t<fileext />\n\t\t\t<cdnthumburl>3057020100044b30490201000204502c9b9f02032f55f902049ed05eda0204629c6867042430623237666238342d656131342d346565342d623531332d3636623738613034373331330204011400030201000405004c4d9900</cdnthumburl>\n\t\t\t<cdnthumbmd5>0c25558dde75066df2e6a78c734e3309</cdnthumbmd5>\n\t\t\t<cdnthumblength>44605</cdnthumblength>\n\t\t\t<cdnthumbwidth>720</cdnthumbwidth>\n\t\t\t<cdnthumbheight>576</cdnthumbheight>\n\t\t\t<cdnthumbaeskey>d9755a6ca7b97d015407fe1c298d11e6</cdnthumbaeskey>\n\t\t\t<aeskey>d9755a6ca7b97d015407fe1c298d11e6</aeskey>\n\t\t\t<encryver>0</encryver>\n\t\t\t<filekey>wxid_ylxtflcg0p8b22_293_1654417511</filekey>\n\t\t</appattach>\n\t\t<extinfo />\n\t\t<sourceusername>gh_0e7477744313@app</sourceusername>\n\t\t<sourcedisplayname>拼多多</sourcedisplayname>\n\t\t<thumburl />\n\t\t<md5 />\n\t\t<statextstr />\n\t\t<directshare>0</directshare>\n\t\t<recorditem><![CDATA[(null)]]></recorditem>\n\t\t<weappinfo>\n\t\t\t<username><![CDATA[gh_0e7477744313@app]]></username>\n\t\t\t<appid><![CDATA[wx32540bd863b27570]]></appid>\n\t\t\t<type>2</type>\n\t\t\t<version>1519</version>\n\t\t\t<weappiconurl><![CDATA[http://mmbiz.qpic.cn/mmbiz_png/I3ht2WMGrPjkBVPwWLHt9LbsXHnXaHKuT6LmFDpvV7jcJSEibYrN1Wc5SpVhRUXxv1vJyCgVETh7m9RRMzYLSiag/640?wx_fmt=png&wxfrom=200]]></weappiconurl>\n\t\t\t<pagepath><![CDATA[pages/index/index.html?share_form=custom_card&refer_share_btn=top_forward&refer_share_source=native&card_v=v8.1.1.2&refer_share_page=index&share_trace_id=10814550078386404&xcx_x_zyw=&share_time=1654417504829&x_scene=1053&_wv=1&refer_share_id=SpqqxE2NUxuMdQx8c3ByMGSOoZL0rvhH&refer_share_uid=5173343201&refer_share_uin=DIFNYVZDC6VVEQDGC5RB57Z4KE_GEXDA&refer_share_pu=x678QhK2L%2FL2LUrCL%23%23ei0&refer_share_channel=message&prefetch=[{\"pre_biz\":\"/compose/vtx/index/multi/main/v2\",\"params\":{\"xcx\":\"20161201\",\"xcx_version\":\"v8.1.1.2\"},\"body\":{\"xcx_trace_id\":\"10814550078386404\",\"scene_id\":1053,\"page_sn\":10002,\"offset\":0,\"count\":6,\"xcx_version\":\"v8.1.1.2\"},\"method\":\"POST\"}]]]></pagepath>\n\t\t\t<shareId><![CDATA[0_wx32540bd863b27570_5a36c4cc14fb8effefecbd92a1f291a6_1654417511_0]]></shareId>\n\t\t\t<appservicetype>0</appservicetype>\n\t\t\t<brandofficialflag>0</brandofficialflag>\n\t\t\t<showRelievedBuyFlag>538</showRelievedBuyFlag>\n\t\t\t<subType>0</subType>\n\t\t\t<isprivatemessage>0</isprivatemessage>\n\t\t</weappinfo>\n\t</appmsg>\n\t<fromusername>wxid_i6qsbbjenjuj22</fromusername>\n\t<scene>0</scene>\n\t<appinfo>\n\t\t<version>1</version>\n\t\t<appname />\n\t</appinfo>\n\t<commenturl />\n"
}

成功返回示例

{
    "code": "1000",
    "message": "发送小程序成功",
    "data": {
        "type": 0,
        "msgId": 697760545,
        "newMsgId": 7645748705605226305,
        "createTime": 1641458149,
        "wcId": "jack_623555049"
    }
}

错误返回示例

{
    "message": "失败",
    "code": "1001",
    "data": null
}
Copyright © wkteam.cn 2020 all right reserved,powered by Gitbook该文件修订时间: 2022-11-28 00:13:18

results matching ""

    No results matching ""