chenxi2015 / dingtalk-service
a dingtalk api service package
0.1
2019-08-01 05:36 UTC
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^8.2
This package is auto-updated.
Last update: 2025-03-29 00:36:54 UTC
README
钉钉的企业api封装包
Installation
The recommended way to install dingtalk-service is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version of dingtalk-service:
php composer.phar require chenxi2015/dingtalk-service # OR composer require chenxi2015/dingtalk-service
Help and docs
Robot API
sendRobotMsg
use Gxheart\Http\Robot; $robot = new Robot(); // text echo $robot->sendRobotMsg('access_token', [ 'content' => '这是内容', 'atMobiles' => [], 'isAtAll' => true ]); // link echo $robot->sendRobotMsg('access_token', [ 'text' => '这是内容', 'title' => '这是标题', 'messageUrl' => '', 'picUrl' => '' ], 'link'); // markdown echo $robot->sendRobotMsg('access_token', [ 'text' => '这是内容', 'title' => '这是标题', 'atMobiles' => [], 'isAtAll' => true ], 'markdown'); // actionCard1 echo $robot->sendRobotMsg('access_token', [ 'title' => '白白管家官网', 'text' => ' 这是用户中心系统的钉钉服务层 author by cx', 'singleTitle' => '阅读全文', 'singleURL' => 'http://www.baibaiguanjia.com', 'btnOrientation' => 0, 'hideAvatar' => 0 ], 'actionCard'); // actionCard2 echo $robot->sendRobotMsg('access_token', [ 'title' => '白白管家官网', 'text' => ' 这是用户中心系统的钉钉服务层 author by cx', 'btns' => [ [ "title" => "内容不错", "actionURL" => "http://www.baibaiguanjia.com/" ], [ "title" => "不感兴趣", "actionURL" => "http://www.baibaiguanjia.com/" ] ], 'btnOrientation' => 0, 'hideAvatar' => 0 ], 'actionCard'); // feedCard echo $robot->sendRobotMsg('access_token', [ 'links' => [ [ "title" => "时代的火车向前开", "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", "picURL" => "https://www.dingtalk.com/" ], [ "title" => "时代的火车向前开2", "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", "picURL" => "https://www.dingtalk.com/" ] ], ], 'feedCard');