钉钉自定义机器人PHP版如何接入
list($s1, $s2) = explode(' ', microtime());
$timestamp = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000);
$secret = 'xxxxx';
$data = $timestamp . '\n' . $secret;
$signStr = base64_encode(hash_hmac('sha256', $data, $secret));
$signStr = utf8_encode(urlencode($signStr));
$webhook = 'https://oapi.dingtalk.com/robot/send?access_token=xxxxx';
$webhook .= '×tamp=$timestamp&sign=$signStr';
这总是提示签名不匹配是怎么肥四{'errcode':310000,'errmsg':'sign not match'}
赞1
踩0