# 渠道管理接口

# 获取渠道列表(企业控制台数据)

GET https://hub.juzibot.com/api/v1/channel/list?token=**

# 请求参数:

名称 类型 是否必须 备注
token string 调用接口凭证
current string 当前页数
pageSize string 每页数据条数

TIP

该API支持批量拉取群信息,最大pageSize为1000

# 返回示例:

{
  errcode: 0,
  errmsg: 'ok',
  data:[{
    state: "4b3e1baf-9deb-4179-a27b-4104bb",
    configId: "108dfd7e1d8a5c1b330800b72016e999",
    remark: "阿达大所多",
    createDate: "2020-04-12T22:27:49.166Z",
    tagNames: [{
      id: "ete6V5EQAAxSCwzd41KdmnhOeGOHnpgg",
      name: "自动化活动审核",
    }, {
      id: "eeeegdCAAAljB-0tZLrdA0eIL55ZNzYQ",
      name: "删除活动测试2",
    }, {
      id: "eeNByCBgAAX2DPyMTZZFm-4NgxsPSXww",
      name: "阿达大所多",
    }]
  }],
  total: 1000,
}

# 返回参数说明:

名称 类型 必定存在 备注
errcode number 返回码
errmsg string 对返回码的文本描述内容
data.state string 二维码唯一标识
data.configId string 二维码的configId
data.remark string 二维码名字
data.createDate string 二维码创建时间
data.tags array 该二维码绑定的标签信息
data.tags.id string 标签id
data.tags.name string 标签名字
total number 渠道总数量

# 创建渠道二维码(只在企业微信侧创建,不会在企业控制台中存在)

POST https://hub.juzibot.com/api/v1/contactWay/add?token=**

# 请求示例:

{
   "type" :1,
   "scene":1,
   "style":1,
   "remark":"渠道客户",
   "skip_verify":true,
   "state":"teststate",
   "user" : ["zhangsan", "lisi", "wangwu"],
   "party" : [2, 3],
   "is_temp":true,
   "expires_in":86400,
   "chat_expires_in":86400,
   "unionid":"oxTWIuGaIt6gTKsQRLau2M0AAAA",
   "conclusions": {
		"text": {
			"content":"文本消息内容"
		},
    "image": {
      "media_id": "MEDIA_ID"
   	},
    "link": {
      "title": "消息标题",
      "picurl": "https://example.pic.com/path",
      "desc": "消息描述",
      "url": "https://example.link.com/path"
    },
    "miniprogram": {
      "title": "消息标题",
			"pic_media_id": "MEDIA_ID",
      "appid": "wx8bd80126147dfAAA",
      "page": "/path/index.html"
    }
  }
}

# 请求参数:

名称 类型 是否必须 备注
token string 调用接口凭证
type number 联系方式类型,1-单人, 2-多人
scene number 场景,1-在小程序中联系,2-通过二维码联系
style number 在小程序中联系时使用的控件样式,详见附表
remark string 联系方式的备注信息,用于助记,不超过30个字符
skip_verify boolean 外部客户添加时是否无需验证,默认为true
state string 企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情”时会返回该参数值,不超过30个字符
user array 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
party array 使用该联系方式的部门id列表,只在type为2时有效
is_temp boolean 是否临时会话模式,true表示使用临时会话模式,默认为false.(只针对特殊行业有效)
expires_in number 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天,最多为14天
chat_expires_in number 场景,1-在小程序中联系,2-通过二维码联系
unionid string 可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
conclusions object 结束语,会话结束时自动发送给客户,可参考“结束语定义(opens new window) ”,仅在is_temp为true时有效,

# 返回示例:

{
  errcode: 0,
  errmsg: 'ok',
  config_id:"42b34949e138eb6e027c123cba77fAAA",
  qr_code:"http://p.qpic.cn/wwhead/duc2TvpEgSdicZ9RrdUtBkv2UiaA/0"
}

# 返回参数说明:

名称 类型 必定存在 备注
errcode number 返回码
errmsg string 对返回码的文本描述内容
config_id string 新增渠道二维码的配置id
qr_code string 渠道二维码链接,仅在scene为2时返回

# 获取渠道二维码信息(获取企业微信中的)

GET https://hub.juzibot.com/api/v1/contactWay/get?token=**

# 请求示例:

{
   "config_id":"42b34949e138eb6e027c123cba77fad7"
}

# 请求参数:

名称 类型 是否必须 备注
token string 调用接口凭证
config_id string 渠道二维码的配置id

# 返回示例:

{
  errcode: 0,
  errmsg: 'ok'
  contact_way: {
    config_id: "42b34949e138eb6e027c123cba77fAAA",
    type: 1,
    scene: 1,
    style: 2,
		remark: "test remark",
		skip_verify: true,
		state: "teststate",
		qr_code: "http://p.qpic.cn/wwhead/duc2TvpEgSdicZ9RrdUtBkv2UiaA/0",
		user: ["zhangsan", "lisi", "wangwu"],
    party: [2, 3],
		is_temp: true,
		expires_in: 86400,
    chat_expires_in: 86400,
		unionid: "oxTWIuGaIt6gTKsQRLau2M0AAAA",
		conclusions: {
      text: {
				"content":"文本消息内容"
			},
      image: {
				pic_url: "http://p.qpic.cn/pic_wework/XXXXX"
    	},
   		link: {
				title: "消息标题",
        picurl: "https://example.pic.com/path",
        desc: "消息描述",
        url: "https://example.link.com/path"
    	},
    	miniprogram: {
        title: "消息标题",
				pic_media_id: "MEDIA_ID",
       	appid: "wx8bd80126147dfAAA",
        page: "/path/index"
   		}
   	}
  }
}

# 返回参数说明:

名称 类型 必定存在 备注
errcode number 返回码
errmsg string 对返回码的文本描述内容
config_id string 渠道二维码的配置id
qr_code string 渠道二维码链接,仅在scene为2时返回
type number 联系方式类型,1-单人, 2-多人
scene number 场景,1-在小程序中联系,2-通过二维码联系
style number 在小程序中联系时使用的控件样式,详见附表
remark string 联系方式的备注信息,用于助记,不超过30个字符
skip_verify boolean 外部客户添加时是否无需验证,默认为true
state string 企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情”时会返回该参数值,不超过30个字符
user array 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
party array 使用该联系方式的部门id列表,只在type为2时有效
is_temp boolean 是否临时会话模式,true表示使用临时会话模式,默认为false.(只针对特殊行业有效)
expires_in number 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天,最多为14天
chat_expires_in number 场景,1-在小程序中联系,2-通过二维码联系
unionid string 可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
conclusions object 结束语,会话结束时自动发送给客户,可参考“结束语定义(opens new window) ”,仅在is_temp为true时有效,

# 获取渠道二维码列表(获取企业微信中的)

POST https://hub.juzibot.com/api/v1/contactWay/list?token=**

# 请求示例:

{
   start_time: 1622476800,
   end_time: 1625068800,
   cursor: "CURSOR",
   limit: 1000
}

# 请求参数:

名称 类型 是否必须 备注
token string 调用接口凭证
start_time number 「联系我」创建起始时间戳, 默认为90天前
end_time number 「联系我」创建结束时间戳, 默认为当前时间
cursor string 分页查询使用的游标,为上次请求返回的 next_cursor
limit number 每次查询的分页大小,默认为100条,最多支持1000条

# 返回示例:

{
  errcode: 0,
  errmsg: 'ok',
  contact_way: [
		{
			config_id: "534b63270045c9ABiKEE814ef56d91c62f"
		}, {
			config_id: "87bBiKEE811c62f63270041c62f5c9A4ef"
		}
	],
	next_cursor: "NEXT_CURSOR"
}

# 返回参数说明:

名称 类型 必定存在 备注
errcode number 返回码
errmsg string 对返回码的文本描述内容
contact_way.config_id string 联系方式的配置id
next_cursor string 分页参数,用于查询下一个分页的数据,为空时表示没有更多的分页
最近更新: 2022/5/25 下午9:07:10