Skip to main content

A simple api for dingding robot

Project description

dingding webhook

This is a simple python api package to send your own message by dingding robot.

#Installation

pip install dingding_webhook

#Usage

send msg

import dingding_webhook.webhook as dingding_webhook


webhook_url="xxx"  # your dingding robot webhook

content = "test text msg"

dingding_webhook.send_text(webhook_url,
                            content, 
                            atMobiles=[], 
                            isAtAll=False)

###Examples

  • text类型
# text类型
# 参数     参数类型   必须    说明
# msgtype   String   是     消息类型,此时固定为:text
# content   String   是     消息内容
# atMobiles Array    否    被@人的手机号(在content里添加@人的手机号)
# isAtAll   bool     否    @所有人时:true,否则为:false

send_text(post_url, content, atMobiles=[], isAtAll=False)

  • link类型
# 参数     参数类型   必须    说明
# msgtype   String    是    消息类型,此时固定为:link
# title     String    是    消息标题
# text      String    是    消息内容。如果太长只会部分展示
# messageUrl String   是    点击消息跳转的URL
# picUrl    String    否 图片URL

send_link(post_url, title, text, picUrl, msgUrl)

  • markdown类型
# 参数     参数类型   必须    说明
# msgtype   String   是     消息类型,此时固定为:markdown
# title     String   是     首屏会话透出的展示内容
# text      String   是     markdown格式的消息
# atMobiles Array    否    被@人的手机号(在content里添加@人的手机号)
# isAtAll   bool     否    @所有人时:true,否则为:false

send_markdown(post_url, title, text, atMobiles=[], isAtAll=False)

  • 整体跳转ActionCard类型
# 参数      类型      必选      说明
# msgtype   string    true    此消息类型为固定actionCard
# title     string    true    首屏会话透出的展示内容
# text      string    true    markdown格式的消息
# btns.btnOrientation  string  false  "0"-按钮竖直排列,"1"-按钮横向排列
# btns.buttons    [{               "title": "内容不错",         "actionURL": "https://www.dingtalk.com/"            },
#           {       "title": "不感兴趣",                "actionURL": "https://www.dingtalk.com/"         }      ]
# hideAvatar      string  false  "0"-正常发消息者头像,"1"-隐藏发消息者头像

send_actionCard(post_url, title, text, btns, hideAvatar="0")

  • FeedCard类型
# FeedCard类型
# 参数      类型      必选      说明
# msgtype string      true    此消息类型为固定feedCard
# cardList array      true      
# 
# cardList[0].title   string      true    单条信息文本
# cardList[0].messageURL  string  true    点击单条信息到跳转链接
# cardList[0].picURL  string      true    单条信息后面图片的URL

send_feedCard(post_url, cardList)

###Documentation

more docs see

dingding doc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dingding_webhook-0.0.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

dingding_webhook-0.0.3-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dingding_webhook-0.0.3.tar.gz.

File metadata

  • Download URL: dingding_webhook-0.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.12

File hashes

Hashes for dingding_webhook-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9c42ee2b11a9b01b001a14858b09289bc13f68a9ea6c5ab74af7998f4d2f3dc2
MD5 901cec3c9d5f185aad7d5f6caa7fa049
BLAKE2b-256 41ab471482343b789245b910d65536de2f6f1661371990cb6d32d732532f3391

See more details on using hashes here.

File details

Details for the file dingding_webhook-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: dingding_webhook-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.12

File hashes

Hashes for dingding_webhook-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 961ce8913e3cb331479cef0ee0b0232e7d8a4eb21e59bebdaad157124eea4a0a
MD5 4aec01bba761c1533751e120e52482eb
BLAKE2b-256 a83fc082bffbb31f9843193211f0a33dbfdba7e9133c163293181fd126b4c925

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page