更新日期:     浏览次数:

1. 公共号订阅管理

1.1. 设置企业订阅

请求URL: https://do.yunzhijia.com/pubacc/api/pubssb?pubid={{pubid}}&mid={{eid}}&ssb=0&time={{timestamp}}&pubtoken={{pubtoken}}

请求方法: POST

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
pubid 公共号id
mid 团队号eid
ssb 1是订阅;0是取消
time 10位unix时间戳
pubtoken pubtoken=sha(mid,pubid,pubsercet,time),请参考公共号密钥验证规则

输出结果:

{
    "success": true
}

1.2. 查询企业是否订阅

请求URL: https://do.yunzhijia.com/pubacc/api/pubssb?pubid={{pubid}}&mid={{eid}}

请求方法: POST/GET

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
pubid 公共号id
mid 团队号eid

输出结果:

{
    "ssb": "1" //1是订阅;0是没有订阅
}

1.3. 设置用户订阅

请求URL: https://do.yunzhijia.com/pubacc/api/pubssb?pubid={{pubid}}&mid={{eid}}&userid=5a39c75ae4b0a5d9edbf1d67&ssb=1&time={{timestamp}}&pubtoken={{pubtoken}}

请求方法: POST

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
pubid 公共号id
mid 团队号eid
userid 用户openid
ssb 1是订阅;0是取消;没有参数,表示查询是否订阅
time 10位unix时间戳
pubtoken pubtoken=sha(mid,pubid,pubsercet,time),请参考公共号密钥验证规则

输出结果:

{
    "success": true
}

1.4. 设置发言人

请求URL: https://do.yunzhijia.com/pubacc/api/pubssb?pubid={{pubid}}&mid={{eid}}&sayid=5a39c75ae4b0a5d9edbf1d67&ssb=0&time={{timestamp}}&pubtoken={{pubtoken}}

请求方法: POST

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
pubid 公共号id
mid 团队号eid
sayid 用户openid
ssb 1是订阅;0是取消;没有参数,表示查询是否订阅
time 10位unix时间戳
pubtoken pubtoken=sha(mid,pubid,pubsercet,time),请参考公共号密钥验证规则

输出结果:

{
    "success": true
}

1.5. 查询订阅用户列表

请求URL: https://do.yunzhijia.com/pubacc/api/pubssbusers?time={{timestamp}}&pubtoken={{pubToken}}&page=0&count=100&pubid={{pubid}}

请求方法: GET

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
pubid 公共号id
page 页码(0是第一页)
count 每页记录数(默认10)
time 10位unix时间戳
pubtoken pubtoken=sha(pubid,pubsercet,time),请参考公共号密钥验证规则

输出结果:

[
    {
        "active": "1",
        "activeTime": "2017-12-26 10:23:14",
        "birthday": "1999-01-15",
        "city": "",
        "companyName": "这是一个高级版",
        "contact": [
            {
                "inputType": "date",
                "name": "生日",
                "permission": "W",
                "publicid": "VIRTUAL",
                "type": "O",
                "value": "1999-01-15"
            },
            {
                "name": "手机",
                "permission": "R",
                "publicid": "VIRTUAL",
                "type": "P",
                "value": "17219901027"
            }
        ],
        "createTime": "2017-12-26 10:23:14",
        "department": "高级动物",
        "eid": "10603457",
        "email": "",
        "fullPinyin": "cheng jian jiang",
        "gender": "1",
        "hireDate": "",
        "id": "5a41b292e4b058cf3d0cf312",
        "identityId": "",
        "isAdmin": 1,
        "isHidePhone": 0,
        "jobNo": "jc002",
        "jobTitle": "我的寂寞是我的泪",
        "name": "成建蒋",
        "networkSubType": "TEAM",
        "oId": "5a41b292e4b058cf3d0cf314",
        "openId": "5a41af0ae4b0820e92cd9868",
        "orgHeader": [
            {
                "orgId": "16373e86-0bcd-11e8-9daf-fa163e48ef01",
                "orgName": "高级动物"
            }
        ],
        "orgId": "16373e86-0bcd-11e8-9daf-fa163e48ef01",
        "orgInfoId": "58df7e16e4b053f44063edca",
        "phone": "17219901027",
        "phones": "17219901027",
        "photoUrl": "http://static.yunzhijia.com/space/c/photo/load?id=5acc1b509b521a2ac2a08482",
        "positiveDate": "",
        "provice": "",
        "registerDate": 1514254090163,
        "status": 1,
        "tid": "10603457",
        "uid": "101341872",
        "updateTime": "2018-06-28 17:24:09",
        "userName": "jiangjc",
        "userType": 10,
        "wbNetworkId": "58df7e16e4b053f44063edca",
        "wbUserId": "5a41af0ae4b0820e92cd9868",
        "weights": 0
    },
...
]

1.6. 查询公共号列表

请求URL: https://do.yunzhijia.com/pubacc/api/xtpubs?mid={{eid}}

请求方法: GET

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
mid 团队号eid

输出结果:

[
    {
        "pid": "XT-d4dfc04c-9416-4b8c-86ca-dc57dc949006",
        "name": "蒋建成公众号测试",
        "time": 1524216957567,
        "photourl": "https://www.yunzhijia.com/pubacc/public/data/17/12/25/kDFLXUgS.png",
        "note": "蒋建成公众号测试qwe",
        "mid": "10603457",
        "midname": "这是一个高级版",
        "account": "",
        "menu": [
            {
                "id": "menu1517189119322",
                "sub": [
                    {
                        "id": "btn1517189356269",
                        "sub": [],
                        "android": "",
                        "ios": "",
                        "name": "链接-百度",
                        "appid": "",
                        "type": "menu",
                        "url": "?_yzj_t_web=true",
                        "key": "",
                        "isOpen": true
                    },
                    ...
                ],
                "android": "",
                "ios": "",
                "name": "你好美女",
                "appid": "",
                "type": "menu",
                "url": "",
                "key": "",
                "isOpen": false
            },
            ...
        ],
        "reply": true,
        "cssb": false,
        "allssb": false,
        "mssb": false,
        "selfssb": true,
        "fold": false,
        "remind": false,
        "tmpl": false,
        "share": false,
        "app": "0",
        "type": 2,
        "state": 2,
        "states": "启用",
        "auto": true,
        "sendMsgByPubPlatform": false,
        "sendMsg2AllByApi": false,
        "sendMsg2SomeByApi": true,
        "replyType": false,
        "grayType": false,
        "safeShare": true,
        "openAd": false,
        "ecosphere": false
    },
    ...
]

1.7. 创建公共号

请求URL: https://do.yunzhijia.com/pubacc/api/pubcreate?sign=xxx&mid=xxx&midname=xxx&name=xxx&photoname=xxx&photo64=xxx&cssb=xxx&allssb=xxx&reply=xxx&remind=xxx

请求方法: POST

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
sign 用mid企业密钥对"name公共号名称"签名后,BASE64编码字符串
mid 团队号eid
midname 企业名称
name 公共号名称
photoname 图标名称
photo64 图标base64
cssb 可订阅[1是、0否]
allssb 全部订阅[1是、0否]
reply 可回复[1是、0否]
remind 可选, 不传默认为false, 为不需要消息推送; 传true为需要消息推送

1.8. 创建公共号菜单

请求URL: https://do.yunzhijia.com/pubacc/api/pubmenu?sign=xxx&mid=xxx&pid=xxx&menu=xxx

请求方法: POST

内容类型: Content-Type: application/x-www-form-urlencoded

输入参数:

参数 说明
sign 用mid企业密钥对"pid"签名后,BASE64编码字符串
mid 团队号eid
pid 公共号pubid
menu 菜单JSON字符串,可参考查询公共号列表接口返回的属性menu

menu属性json示例如下:

{
      "id": "menu1489391911113", //id
      "android": "", //Android 应用:安装地址或本地调用协议
      "ios": "", //IOS 应用 :安装地址或本地调用协议
      "name": "我要吐槽", //菜单名称
      "appid": "", //应用id
      "type": "view",  //类型:menu:菜单,click:按钮,url:链接,view:轻应用,app:移动原生应用
      "url": "https://www.baidu.com/",  //跳转地址
      "key": "" //键值:用于唯一识别此菜单项的标识符
 }

1.9. 状态返回值规范

1.9.1. 成功

当消息发送请求被成功执行时,HTTP状态码返回200。

1.9.2. 失败

参考公共号消息发送API

1.10. FAQ

results matching ""

    No results matching ""