To obtain user information in the exclusive DingTalk, you need to obtain access_token. Let me record the process of obtaining access_token.
1: Download the corresponding version of the SDK: https://openplatform-portal.dg-work.cn/portal/#/helpdoc?docKey=gjyzy&slug=st5ct2
Here I use PHP, so I downloaded the PHP version of the SDK, you can download the corresponding version of the SDK according to your actual situation
2: Get access_token
//获取access_token
try {
$executableClient = new ExecutableClient();
//Saas环境域名为:https://openplatform.dg-work.cn,浙政钉环境域名为:https://openplatform-pro.ding.zj.gov.cn
$executableClient->setDomain('域名');
$executableClient->setAccessKey('应用App Key');
$executableClient->setSecretKey('应用App Secret');
$executableClient->setApiName('/gettoken.json');
$result = $executableClient->epaasCurlGet(3);
} catch (\Exception $e) {
$msg = "getFilterWords|err, code: ". $e->getCode() . "|message: ". $e->getMessage();
Yii::error($msg);
return false;
}
$accessToekn = '';
if (isset($result['success']) && $result['success']) {
$accessToekn = $result['data']['accessToken'];
}
return $accessToekn;
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。