PHPackages                             iamzz-cn/dingding-webhook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iamzz-cn/dingding-webhook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iamzz-cn/dingding-webhook
=========================

钉钉群机器人SDK

1.0.3(4y ago)34.4k↓50%MITPHPPHP &gt;=7.2

Since Dec 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Iamzz-cn/dingding-webhook)[ Packagist](https://packagist.org/packages/iamzz-cn/dingding-webhook)[ RSS](/packages/iamzz-cn-dingding-webhook/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

Dingtalk robot php version SDK
==============================

[](#dingtalk-robot-php-version-sdk)

[dingtalk robot api](https://ding-doc.dingtalk.com/document#/org-dev-guide/custom-robot) SDK for PHP

by [iamzz](http://www.iamzz.cn)

Introduction
------------

[](#introduction)

The DingTalk group chat robot PHP package version is used to quickly send DingTalk group chat robot messages.

Requirement
-----------

[](#requirement)

- php &gt;= 7.2
- ext-json &gt;= \*

Usage
-----

[](#usage)

To use this library with Composer, first install it with:

```
$ composer require iamzz-cn/dingding-webhook
```

Get the robot's access token through the DingTalk client (pc). It is recommended to sign the security settings (of course you can choose all) to get the access key secret.

```
use Iamzz\Dingtalk\Dingding;
use Iamzz\Dingtalk\MsgType\ActionCard;
use Iamzz\Dingtalk\MsgType\FeedCard;
use Iamzz\Dingtalk\MsgType\Link;
use Iamzz\Dingtalk\MsgType\Markdown;
use Iamzz\Dingtalk\MsgType\Text;

//Instantiate an instance of the \Iamzz\Dingtalk\Dingding class
$dd = new Dingding('token','secret');

//Instantiate the message type instance
//textType
$message = new Text('我就是我, {a}是不一样的烟火');
$message->setAtMobiles(['a' => '188xxxx8888']);
$message->setIsAll(true);
//linkType
$title = '时代的火车向前开';
$text = '这个即将发布的新版本，创始人xx称它为红树林。而在此之前，每当面临重大升级，产品经理们都会取一个应景的代号，这一次，为什么是红树林';
$messageUrl = 'https://www.dingtalk.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI';
$message = new Link($title, $text, $messageUrl);
//markdownType
$title = '杭州天气';
$text = "#### 杭州天气 {a} \n> 9度，西北风1级，空气良89，相对温度73%\n> ![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png)\n> ###### 10点20分发布 [天气](https://www.dingtalk.com) \n";
$message = new Markdown($title, $text);
$message->setAtMobiles(['a' => '188xxxx8888']);
//整体跳转ActionCard类型
$title = '乔布斯 20 年前想打造一间苹果咖啡厅，而它正是 Apple Store 的前身';
$text = "![screenshot](https://gw.alicdn.com/tfs/TB1ut3xxbsrBKNjSZFpXXcXhFXa-846-786.png)\n ### 乔布斯 20 年前想打造的苹果咖啡厅\n Apple Store 的设计正从原来满满的科技感走向生活化，而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划";
$buttons = [
    '阅读全文' => 'https://www.dingtalk.com/',
];
$message = new ActionCard($title, $text, $buttons);
//独立跳转ActionCard类型
$buttons = [
    '阅读全文1' => 'https://www.dingtalk.com/',
    '阅读全文2' => 'https://www.dingtalk.com/',
];
$message = new ActionCard($title, $text, $buttons);
//feed card
$feedCardData = [
    [
        'title'      => '时代的火车向前开1',
        'messageURL' => 'https://www.dingtalk.com/',
        'picURL'     => 'https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png',
    ],
    [
        'title'      => '时代的火车向前开2',
        'messageURL' => 'https://www.dingtalk.com/',
        'picURL'     => 'https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png',
    ],
];
$message = new FeedCard($feedCardData);

//Send through the `send()` method of the `\Iamzz\Dingtalk\Dingding` instance object
$dd->send($message);
```

The text and markdown type messages support automatic filling of @ information, for example:

```
//如果消息体内需要展示出"{"，请使用"\{"转义。
use Iamzz\Dingtalk\MsgType\Text;
$text = new Text('test content \{a\}');
$text->setAtMobiles(['a'=>'150xxxxxxxx']);
```

Supported message types
-----------------------

[](#supported-message-types)

- text类型
- link类型
- markdown类型
- 整体跳转ActionCard类型
- 独立跳转ActionCard类型
- FeedCard类型

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~166 days

Total

4

Last Release

1482d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/808f203a6a84594667ee1368444c89f33fc61edbc0450c8a5e6c66ac2e987c49?d=identicon)[iamzz](/maintainers/iamzz)

---

Top Contributors

[![hideplan](https://avatars.githubusercontent.com/u/163526983?v=4)](https://github.com/hideplan "hideplan (16 commits)")[![Iamzz-cn](https://avatars.githubusercontent.com/u/21697242?v=4)](https://github.com/Iamzz-cn "Iamzz-cn (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iamzz-cn-dingding-webhook/health.svg)

```
[![Health](https://phpackages.com/badges/iamzz-cn-dingding-webhook/health.svg)](https://phpackages.com/packages/iamzz-cn-dingding-webhook)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
