用 Smartsheets 替换我们现有的界面将非常有用,因为客户端已经使用 Smartsheets,而我们的原型有点笨拙。为此,我正在构建一个原型以学习 Smartsheet API,但当我尝试设置 webhook 时它会中断。
这是我尝试更新/启用 webhook 时的输出:
{"message": "SUCCESS",
"resultCode": 0,
"result": {
"id": 4253946970695556,
"name": "Webhook_test",
"apiClientId": "3oqnphhimgqzyimk40",
"apiClientName": "ChoiceIP",
"scope": "sheet",
"scopeObjectId": 7055538769946500,
"events": [
"*.*"
],
"callbackUrl": "https://ghwd.net/write_requests_to_log.php",
"sharedSecret": "kpnc4nz7gwy91yjzcah2s6neq",
"enabled": false,
"status": "DISABLED_VERIFICATION_FAILED",
"disabledDetails": "An error occurred during SSL handshake. (ref id: fwhc0949r7km)",
"version": 1,
"createdAt": "2016-07-06T12:04:13Z",
"modifiedAt": "2016-07-07T06:04:20Z"
}
}
这是应该创建响应的脚本中的代码:
$headers = getallheaders();
if( isset( $headers['smartsheet-hook-challenge'] ) ) {
header("Smartsheet-Hook-Response: " . $headers['smartsheet-hook-challenge']);
echo $headers['smartsheet-hook-challenge'];
return;
} else if( isset( $_POST['smartsheet-hook-challenge'] ) ) {
header("Smartsheet-Hook-Response: " . $_POST['smartsheet-hook-challenge']);
echo $_POST['smartsheet-hook-challenge'];
return;
} else {
header("Smartsheet-Hook-Response: debug");
}
为什么 SSL 握手失败?