PHP code example of srako / webman-dingtalk
1. Go to this page and download the library: Download srako/webman-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/ */
srako / webman-dingtalk example snippets
$params = [
'agent_id' => env('DINGTALK_AGENTID'),
'userid_list' => '0841582759859766',
'msg' => [
'msgtype' => 'text',
'text' => [
'content' => '当前时间:'.date('Y-m-d H:i:s'),
],
],
];
$ret = DingTalk::post('/topapi/message/corpconversation/asyncsend_v2', $params);
bash
php webman dingtalk:RefreshDepartmentsAndUsers