PHP code example of zhangdi / dingtalk

1. Go to this page and download the library: Download zhangdi/dingtalk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zhangdi / dingtalk example snippets




use ZhangDi\Sdk\DingTalk\Application;

// 发送机器人文本消息
$config = [
    'robot'=> [
        'access_token' => '你的群机器人 Access Token',
    ],
];

$app = new Application($config);
$rs = $app->robot->sendText("Hello World");

var_dump($rs);