模板消息
liaoyongfei editou esta páxina %!s(int64=4) %!d(string=hai) anos
1.模板消息列表页
  • url: /wx/message/getTemplateMsgOfPage/{appId}
  • 协议:http
  • 请求方法: post
  • 请求参数格式:"application/json"
  • 字符集:UTF-8
  • 请求参数
参数 类型 是否必须 描述
appId String 公众号appid-在url中传入
pageIndex int 页码
pageSize int 页容量
filters String 查询条件如[{"field":"name","operate":"contains","value":""}]
  • 返回参数
  • 格式:json

    {
    "success": 1,   //成功标识 1成功 其它失败
    "messageCode": 200, //返回编号
    "message": "操作成功!", //返回说明
    "result": "查询成功",   //
    "items": [  //返回数据集
        {
            "id": 1,    //配置id
            "theme": "aa",  //推送主题
            "setup": 0, //推送设置-0立即推送 1定时推送 
            "sendTime": null,   //推送时间
            "state": 0, //状态 0草稿 1未发送 2发送中 3已发送
            "contentFields": "first,keyword1",  //
            "contentValue":"{"first":{"color":"#000000","value":"测试的啊|$fansName$|","prefix":""},"keyword1":...}",   //关键词配置值
            "jumpType": 0,  //跳转类型 0不跳转 1跳url 2跳小程序
            "messageId": 4436,  //消息id
            "appId": "wx4f8c9fef3896ad71",  //
            "tagIds": null, //推送对象id
            "persons": null,    //推送人数
            "tagNames": null,   //推送对象名称
            "templateId": "KZ1VmZvvx1P2OH5nxTZcSGKYN4", //模板id
            "content":   "{{first.DATA}}\n用药时间:{{keyword1.DATA}}\n药品名称及用法用量:{{keyword2.DATA}}\n{{remark.DATA}}",    //模板内容
            "example": "用药提醒 9月18日\r\n用药时间:2017-09-18 12:30  
            "\r\n药品名称及用法用量:阿司匹林口服3粒\r\nxxx患者您好,您设定的用药时间已到,为了更好的康复,请您按时服用药物,谢谢!"   //模板示例
            "stateName": "草稿",    //状态名称
            "title": "用药提醒",    //模板标题
            "contentValueList": null
        }
    ],
    "totalCount": 1 //全部记录数
    }
    
    2.删除模板消息
  • url: /wx/message/deleteTemplateMsg/{appId}

  • 协议:http

  • 请求方法: post

  • 请求参数格式:"application/x-www-form-urlencoded"

  • 字符集:UTF-8

  • 请求参数

参数 类型 是否必须 描述
appId String 公众号appid 在url中传入
idList String 配置id 多个id用英文,分隔
  • 返回参数
  • 格式:json

    {
    "success": 1,   //成功标识 1成功 其它失败
    "messageCode": 200,     //返回编号
    "message": "操作成功",  //返回说明
    "result": null,
    "items": null,
    "totalCount": 0
    }
    
    3.获取模板消息(点击创建模板消息群发)
  • url: /wx/message/getWxTemplateMsg/{appId}

  • 协议:http

  • 请求方法: post

  • 请求参数格式:"application/json"

  • 字符集:UTF-8

  • 请求参数

参数 类型 是否必须 描述
appId String 公众号appid 在url中传入
  • 返回参数
  • 格式:json

    {
    "success": 1,   //成功标识 1成功 其它失败
    "messageCode": 200,    //返回编号
    "message": "操作成功!", //返回说明
    "result": "查询成功",
    "items": [
        {
            "msgId": 4436,  //消息id
            "msgType": "template",
            "qrcodeId": null,
            "content": "{{first.DATA}}\n用药时间:{{keyword1.DATA}}\n药品名称及用法用量:{{keyword2.DATA}}\n{{remark.DATA}}",
            "mediaId": null,
            "title": "用药提醒",    //模板标题
            "description": "aa",
            "url": null,
            "thumbUrl": null,
            "pagepath": null,
            "thumbMediaId": null,
            "miniProgramAppId": null,
            "miniAppTitle": null,
            "channel": 3,
            "industry": "医疗护理-医药医疗",
            "example": "用药提醒 9月18日\r\n用药时间:2017-09-18 12:30\r\n药品名称及用法用量:阿司匹林口服3粒\r\n  
            "xxx患者您好,您设定的用药时间已到,为了更好的康复,请您按时服用药物,谢谢!",  //模板示例
            "templateId": "W8m9MEAuiDlGdaJ9-KZ1VmZvvx1P2OH5nxTZcSGKYN4",    //模板消息id
            "menuId": null,
            "appId": "wx4f8c9fef3896ad71",
            "applicationId": null,
            "localUrl": null,
            "materialUrl": null,
            "remark": null
        }
    ],
    "totalCount": 1
    }
    
    4.同步微信模板消息
  • url: /wx/message/synWxTemplateMsg/{appId}

  • 协议:http

  • 请求方法: post

  • 请求参数格式:"application/json"

  • 字符集:UTF-8

  • 请求参数

参数 类型 是否必须 描述
appId String 公众号appid 在url中传入
  • 返回参数
  • 格式:json

    {
    "success": 1,   //成功标识 1成功 其它失败
    "messageCode": 200,    //返回编号
    "message": "操作成功",  //返回说明
    "result": [
        {
            "msgId": 4436,    //消息id
            "msgType": "template",
            "qrcodeId": null,
            "content": "{{content.DATA}}",
            "mediaId": null,
            "title": "订阅模板消息",        //消息标题
            "description": null,
            "url": null,
            "thumbUrl": null,
            "pagepath": null,
            "thumbMediaId": null,
            "miniProgramAppId": null,
            "miniAppTitle": null,
            "channel": 3,
            "industry": "-",
            "example": "",  //模板示例
            "templateId": "ORmuM7JS5YYqrynW9M-b7-pAzcZKwSgijftqHePM1Rc", //模板消息id
            "menuId": null,
            "appId": "wx4f8c9fef3896ad71",
            "applicationId": null,
            "localUrl": null,
            "materialUrl": null,
            "remark": null
        }
    ],
    "items": null,
    "totalCount": 0
    }
    
    5.点击编辑/选中模板消息点下一步
  • url: /wx/message/beginEditTemplateMsg/{appId}

  • 协议:http

  • 请求方法: post

  • 请求参数格式:"application/x-www-form-urlencoded"

  • 字符集:UTF-8

  • 请求参数

参数 类型 是否必须 描述
appId String 公众号appid在url中传入
templateId String 模板消息id 在url中传入
templateMsgId int 列表页的配置id,新增可不传或传0
  • 返回参数
  • 格式:json

    {
    "success": 1,   //成功标识 1成功 其它失败
    "messageCode": 200,    //返回编号
    "message": "操作成功",  //返回说明
    "result": {
        "id": 0,    //配置id
        "theme": "",    //推送主题
        "setup": 0, //推送设置-0立即推送 1定时推送 
        "sendTime": null,   //推送时间
        "state": 0, //状态 0草稿 1未发送 2发送中 3已发送
        "contentFields": "content",
        "contentValue": "{\"content\":\"\"}",   //关键词配置值
        "contentValueList": [
            {
                "color": "#000000", //颜色
                "prefix": "用药时间:",   //前面的信息
                "lable": "first",   //key
                "message": "first未填写",   //未填提示
                "value": "" //value
            }]
        "jumpType": 0,  //跳转类型 0不跳转 1跳url 2跳小程序
        "messageId": 4920,  //消息id
        "appId": "wx4f8c9fef3896ad71",  //公众号appId
        "tagIds": "",   //推送标签id
        "persons": null,    //
        "tagNames": "", //推送标签名称
        "templateId": "ORmuM7JS5YYqrynW9M-b7-pAzcZKwSgijftqHePM1Rc",    //模板消息id
        "url": "",  //点击跳转url
        "miniProgramAppId": "", //点击跳转小程序appid
        "pagePath": "", //点击跳转小程序页面路径
        "content": null,
        "example": null
    },
    "items": null,
    "totalCount": 0
    }
    
    6.保存消息
  • url: /wx/message/saveTemplateMsg/{appId}

  • 协议:http

  • 请求方法: post

  • 请求参数格式:"application/x-www-form-urlencoded"

  • 字符集:UTF-8

  • 请求参数

参数 类型 是否必须 描述
appId String 在url中传入
id int 新增传0或不传,编辑要传
theme int 推送主题
setup int 推送设置-0立即推送1定时推送
sendTime Datetime 推送时间
state int 状态0草稿1未发送2发送中3已发送
contentFields String 按返回的值原样上传
contentValue String 关键词配置(json格式字符串){lable:{value: ,color: ,prefix: },lable2:{value: ,color: ,prefix: }}
jumpType int 跳转类型 0不跳转 1跳url 2跳小程序
messageId int 消息id
appId String 公众号appId
tagIds String 推送标签id集合 多个用英文,分隔
persons int 推送人数
tagNames String 推送标签名称
templateId String 模板消息id
url String 跳转url 选了跳转url时上传,没选可传“”空串
miniProgramAppId String 跳转小程序appid 选了跳转小程序时上传,没选可传“”空串
pagePath String 跳转小程序页面路径 选了跳转小程序时上传,没选可传“”空串
  • 返回参数
  • 格式:json { "success": 1, //成功标识 1成功 其它失败 "messageCode": 200, //返回编号 "message": "操作成功", //返回说明 "result": null, "items": null, "totalCount": 0 }