1

用 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 握手失败?

4

1 回答 1

2

您需要为域 ghwd.net 设置有效的 SSL 证书,或使用具有有效 SSL 证书的域。

创建 webhook 时,Smartsheet 将首先尝试通过安全连接连接到您的回调 URL。如果无法建立安全连接,则 webhook 将被禁用,并显示您所看到的状态,DISABLED_VERIFICATION_FAILED.

Smartsheet Webhook 文档

于 2016-07-07T17:30:55.640 回答