当前位置:   article > 正文

飞书机器人小助手@特定人_feishu机器人如何@发送的人

feishu机器人如何@发送的人

文档接口: https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN

创建机器人小助手

 

消息推送测试

  1. import requests
  2. import json
  3. url = "https://open.feishu.cn/open-apis/bot/v2/hook/bdd450c0-db1b-4xxxxx"
  4. headers = {"Content-Type": "application/json"}
  5. body = json.dumps({"msg_type": "text","content": {"text":"request example"}})
  6. response = requests.request("POST", url, headers=headers, data=body)
  7. print(response.text)

获取艾特人 open_id

  1. import requests
  2. import json
  3. url = "https://open.feishu.cn/open-apis/contact/v3/users/batch_get_id"
  4. headers = {"Content-Type": "application/json","Authorization": "Bearer t-7f1bcd13fc57d46bac21793a18e560"}
  5. body = json.dumps({"emails": ["邮箱"],"mobiles": ["手机号"]})
  6. response = requests.request("POST", url, headers=headers, data=body)
  7. print(response.text)

@特定人请求

  1. import requests
  2. import json
  3. url = "https://open.feishu.cn/open-apis/bot/v2/hook/bdd450c0-db1b-4xxxxx"
  4. headers = {"Content-Type": "application/json"}
  5. body = json.dumps({"msg_type": "text","content": {"text": "<at user_id = \"open_id\">Tom</at> text content"}})
  6. response = requests.request("POST", url, headers=headers, data=body)
  7. print(response.text)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/498586
推荐阅读
相关标签
  

闽ICP备14008679号