美文网首页
钉钉消息

钉钉消息

作者: Habit_1027 | 来源:发表于2020-01-04 08:42 被阅读0次

    一、自定义机器人

    image image image image image image image

    郑重警告⚠️

    每个机器人每分钟只可以发送 20 条信息,多了,会被禁止使用 10 分钟.

    shell 示例代码

    msg='shark:我就是我'
    url="https://oapi.dingtalk.com/robot/send?access_token=bd5fb98176ad5c5a1a34cb7147cac10c847e9c37e3c31e30311cc413079c899f"
    curl $url \
       -H 'Content-Type: application/json' \
       -d '{"msgtype": "text",
            "text": {
                 "content": "'${msg}'"
            }
          }'
    
    

    python 示例代码

    import requests
    
    content = {
        "msgtype": "text",
        "text": {
            "content": "出发!"
        },
        "at": {
    #        "atMobiles": [
    #            # 单独 @ 某个人
    #            "131xxxxxx81"
    #        ],
    #        "isAtAll": False
    
            # @ 所有人
            "isAtAll": True
        }
    }
    
    headers = {"Content-Type": "application/json;charset=utf-8"}
    
    url = "https://oapi.dingtalk.com/robot/send?access_token=xxx"
    
    r = requests.post(url=url,headers=headers,json=content)
    print(r.content)
    
    

    </article>

    0人点赞

    Python3基础语法(课件)

    相关文章

      网友评论

          本文标题:钉钉消息

          本文链接:https://www.haomeiwen.com/subject/jlrxactx.html