1.搭建飞书机器人:https://botbuilder.feishu.cn/home
飞书机器人参数配置:
Webhook 地址(是默认的,要填到钉钉机器人里)
https://www.feishu.cn/flow/api/trigger-webhook/xx
– 钉钉机器人触发
//参数:
{"chatbotCorpId" :"ding8e05045117b97cd7ee0f45d8e4f7c288",
"chatbotUserId":"$:LWCP_v1:$NKgmUQ0y/bZXBwQaYcWrs7L4knVkqT+2" ,
"conversationId":"cidRZc9BoKW6TWO7Hf3Wb80j+gYe+GF5FxNaJ4CzuO+AtT=",
"conversationType":"1" ,
"createAt":1699109450136,
"isAdmin":true,
"msgId":"msg2jtCPjuPTxGeGhIrD08IMQ==",
"msgtype" :"text" ,
"robotCode":"dingdbku2fgvvaynsajq",
"senderCorpId":"ding8e05045117b97cd7ee0f45d8e4f7c288",
"senderTd":"$:LWCP_v1:$/Zcnnv1/A/hmH71hcTbxGA==",
"senderNick":"驿站",
"senderStaffId":"manager5321",
"sessionWebhook":"https://oapi.dingtalk.com/robot/sendBySession?session=64e9b7a60123e083e8bd54a4e12e0a5f",
"sessionWebhookExpiredTime":1699114850340,
"text" : { "content":"你好"}
}
2.发送 HTTP 请求—获取影刀token
请求方式
1.GET
URL
2.https://api.yingdao.com/oapi/token/v2/token/create?accessKeyId=xxx&accessKeySecret=xxx
返回值示例
{
"data": {
"accessToken": "",
"expiresIn": 7199
},
"code": 200,
"success": true,
"requestId": ""
}
3.发送 HTTP 请求—连接影刀应用
请求方式
POST
URL
https://api.yingdao.com/oapi/dispatch/v2/task/start
请求头示例
步骤2获取的token
添加请求头:
Bearer后面加一个空格
Authorization | Bearer |
content-type | application/json |
写入请求体示例
示例1:
{
"accountName": "影刀账号",
"scheduleUuid": "影刀应用UUid",
"scheduleRelaParams": [
{
"robotUuid": "应用id",
"params": [
{
"name": "xxx",
"value": "",
"type": "str"
},
{
"name": "消息发送人",
"value": "",
"type": "str"
}
]
}
]
}
需要进行压缩
返回值示例
{"data": [{"scheduleUuid": "", "scheduleName": "", "scheduleType": "manual", "cronInterface": {"minimumIntervalSeconds": 60, "type": "manual", "minute": 1, "hour": 1, "dayOfWeeks": [], "month": 1, "time": "", "cronExpress": ""}, "enabled": true, "createTime": "", "updateTime": ""}], "page": {"total": 1, "size": 10, "page": 1, "pages": 1, "offset": 0, "order": "desc"}, "code": 200, "success": true, "msg": ""}
搭建流程
1.飞书机器人搭建流程