ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
<br> [**点此进入芝麻小客服官网**](https://xiaokefu.com.cn/?source=kanyun_t_mia ) <br> ## 通过api接口自动打标签 此功能仅适用于公众号,主要作用是将指定的openid或unionid通过api接口将标签打到小客服后台及公众号后台。 </h> 步骤1:获取accessToken。 </h> 请求地址:https://xiaokefu.com.cn/zhimaOpen/Access/GetAccessToken </h> ![](https://img.kancloud.cn/a9/24/a924e492e5b3eb08698fafd3208df579_949x656.png) </h> 芝麻id和芝麻secret获取位置: ![](https://img.kancloud.cn/d2/8c/d28cf38011dc60aa4ae4bb01fc2d9608_1269x796.png) </h> </h> 步骤2:获取应用ID和标签ID。 </h> 应用ID获取方式:进入小客服后台,在客服系统或公众号助手选中指定的应用,浏览器网址中wechatapp_id就是应用ID。 </h> ![](https://img.kancloud.cn/99/56/99564438e1d72dcfc5ecec821a451364_1140x520.png) </h> </h> 标签ID获取方式: </h> 请求地址:https://xiaokefu.com.cn/zhimaOpen/openAutoLabel/getLabel </h> ![](https://img.kancloud.cn/24/8a/248a65b1b0d6b3e6cb6f4585e89c332b_1193x720.png) </h> </h> ~~~ 请求示例: { "access_token": "access_token", "wechatapp_id": 209459 } 返回结果: { "res": 0, "msg": "获取成功", "data": [{ "_id": "1", "name": "标签1" }, { "_id": "2", "name": "标签2" }, { "_id": "3", "name": "标签3" } ] } ~~~ <br> <br> <br> 步骤3:通过接口打标签 </h> 接口请求地址:https://xiaokefu.com.cn/zhimaOpen/openAutoLabel/setLabel </h> ![](https://img.kancloud.cn/67/fd/67fd96c37d6c98402065efa2bffd8509_1297x819.png) </h> </h> </h> openid自动打标签请求示例: <br> ~~~ 请求示例1: { "access_token": "access_token", "wechatapp_id": 209459, "openid": "ofmLCv26hS0WXcNn9pAczfBB12Fg", "add_tag_ids": "243192,243286,243452", "del_tag_ids": "243456,243457" } 请求示例2: { "access_token": "access_token", "wechatapp_id": 209459, "openid": "ofmLCv26hS0WXcNn9pAczfBB12Fg", "add_tag_ids": "243192,243286,243452" } 请求示例3: { "access_token": "access_token", "wechatapp_id": 209459, "openid": "ofmLCv26hS0WXcNn9pAczfBB12Fg", "del_tag_ids": "243456,243457" } 返回结果: { "res": 0, "msg": "推送成功" } ~~~ <br> unionid自动打标签请求示例: </h> </h> ~~~ 请求示例: { "access_token": "access_token", "wechatapp_id": 209459, "unionid": "ofmLCv26hS0WXcNn9pAczfBB12Fg", "add_tag_ids": "243192,243286,243452", "del_tag_ids": "243456,243457" } ~~~ 请注意unionid和openid其一必填。如果请求参数中同时有openid和unionid,会优先取openid。 </h> </h> <br> <br> <br> <br><br> [**点此进入芝麻小客服官网**](https://xiaokefu.com.cn/?source=kanyun_b_mia ) 您有问题需要咨询的话,可以扫描下方二维码: </h> ![](https://img.kancloud.cn/04/a1/04a1fd65b5f5cfbc32ad431a32fabd2a_200x199.png) </h> </h>