码迷,mamicode.com
首页 > 系统相关 > 详细

Shell中通过机器人发送钉钉群消息

时间:2018-07-09 23:43:17      阅读:1468      评论:0      收藏:0      [点我收藏+]

标签:src   .com   image   process   需要   ref   eid   spm   title   

场景:在平时的工作中,经常需要执行一些定时任务,并且当定时任务执行失败后需要告警出来到钉钉群,使用[钉钉机器人]可以简单快速的帮我们完成这件事情。


  • 简单使用



curl 'https://oapi.dingtalk.com/robot/send?access_token=9e2549f6a0bb28767bdexxxxxxxxxxxxxxxxxx81975c981005abbd'    -H 'Content-Type: application/json'    -d '
  {"msgtype": "text", 
    "text": {
        "content": "我就是我, 是不一样的烟火"
     }
  }'

效果图:

技术分享图片



  • 发送文本内容并@指定的人


curl 'https://oapi.dingtalk.com/robot/send?access_token=9e2549f6a0xxxxxxxxxxxxxxxxxx447981975c981005abbd' -H 'Content-Type: application/json' -d '{"msgtype":"text","text":{"content":"我就是我, 是不一样的烟火"},"at":{"atMobiles":["176xxxx1234"],"isAtAll":false}}'

效果图:

技术分享图片

Shell中通过机器人发送钉钉群消息

标签:src   .com   image   process   需要   ref   eid   spm   title   

原文地址:http://blog.51cto.com/simplelife/2139494

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!