- Overview of OpenAPI
- SlackOpenAPI
- ShopifyOpenAPI
- GithubAPI
- DiscordOpenAPI
- 历史文档(不推荐)
- 开发钉钉应用
- 服务端API
- 新版服务端API(DingTalk OpenAPI)
- 生态伙伴API
客户联系「联系我」管理-更新企业已配置的「联系我」方式
POST
http://127.0.0.1/cgi-bin/externalcontact/add_contact_way
第三方应用开发/客户联系/企业服务人员管理
最后修改时间:2022-08-30 03:03:36
责任人:未设置
通过API添加的「联系我」不会在管理端进行展示,每个企业可通过API最多配置50万个「联系我」。
用户需要妥善存储返回的config_id,config_id丢失可能导致用户无法编辑或删除「联系我」。
临时会话模式不占用「联系我」数量,但每日最多添加10万个,并且仅支持单人。
临时会话模式的二维码,添加好友完成后该二维码即刻失效。
当设置为临时会话模式时(即is_temp为true),联系人仅支持配置为单人,暂不支持多人
使用unionid需要调用方(企业或服务商)的企业微信“客户联系”中已绑定微信开发者账户
原文档地址:
https://open.work.weixin.qq.com/api/doc/92228
https://open.work.weixin.qq.com/api/doc/90000/90135/92572
https://open.work.weixin.qq.com/api/doc/90001/90143/92577
请求参数
Query 参数
access_token
string
调用接口凭证
示例值:
{{accesstoken}}
Body 参数application/json
type
integer
必需
scene
integer
必需
style
integer
可选
remark
string
必需
skip_verify
boolean
必需
state
string
必需
user
array[string]
必需
party
array[integer]
必需
is_temp
boolean
必需
expires_in
integer
必需
chat_expires_in
integer
必需
unionid
string
必需
conclusions
object
必需
text
object
必需
image
object
必需
link
object
必需
miniprogram
object
必需
field1
string
必需
示例
{
"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"
}
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://127.0.0.1/cgi-bin/externalcontact/add_contact_way?access_token={{accesstoken}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"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"
}
}
}'
返回响应
🟢200成功
application/json
Body
errcode
integer <int32>
返回码
errmsg
string
可选
config_id
string
可选
qr_code
string
可选
示例
{
"errcode": 0,
"errmsg": "string",
"config_id": "string",
"qr_code": "string"
}

修改于 2022-08-30 03:03:36