文档接口: https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN
创建机器人小助手
消息推送测试
import requests
import jsonurl = "https://open.feishu.cn/open-apis/bot/v2/hook/bdd450c0-db1b-4xxxxx"headers = {"Content-Type": "application/json"}
body = json.dumps({"msg_type": "text","content": {"text":"request example"}})response = requests.request("POST", url, headers=headers, data=body)
print(response.text)
获取艾特人 open_id
import requests
import jsonurl = "https://open.feishu.cn/open-apis/contact/v3/users/batch_get_id"headers = {"Content-Type": "application/json","Authorization": "Bearer t-7f1bcd13fc57d46bac21793a18e560"}
body = json.dumps({"emails": ["邮箱"],"mobiles": ["手机号"]})response = requests.request("POST", url, headers=headers, data=body)
print(response.text)
@特定人请求
import requests
import jsonurl = "https://open.feishu.cn/open-apis/bot/v2/hook/bdd450c0-db1b-4xxxxx"
headers = {"Content-Type": "application/json"}
body = json.dumps({"msg_type": "text","content": {"text": "<at user_id = \"open_id\">Tom</at> text content"}})response = requests.request("POST", url, headers=headers, data=body)
print(response.text)