我使用的是版本6的echosine api,
我需要为从协议中获取事件创建webhook。
我正在测试从以下网址创建webhook:
https://secure.na1.echosign.com/public/docs/restapi/v6#!/webhooks/createWebhook
我在这里传递了以下详细信息:
{
"name": "agreement history",
"scope": "USER",
"state": "ACTIVE",
"webhookSubscriptionEvents": [
"AGREEMENT_CREATED"
],
"webhookUrlInfo": {
"url": "MY_SITE_URL_TO_GET_WEBHOOK_EVENT_RESPONSE.php"
}
}
在MY_SITE_URL_TO_GET_WEBOOK_EVENT_RESPONSE.php文件中,我编写了如下代码,
<?php
$headers =array();
foreach (getallheaders() as $name => $value) {
$headers[$name] = $value;
}
$myfile = "webhookResponse.txt";
$fh = fopen($myfile, 'a');
fwrite($fh, $_POST."n");
fclose($fh);
http_response_code(200);
return json_encode(["xAdobeSignClientId" => $headers["X-AdobeSign-ClientId"]]);
?>
当我启动创建webhook的请求时,
它给我的回应如下,
{
"code": "INVALID_API_ACCESS_POINT",
"message": "Request must be made to correct API access point (e.g. use GET /baseUris)."
}
响应代码为403。
如何解决这个问题???
如何使用adobeechosine创建webhook?
要进行任何EchoSign API调用,首先,您需要通过调用GET/baseUris端点-来获得正确的API访问点
https://api.na1.echosign.com/api/rest/v6/baseUris
上述呼叫的响应看起来像这个
{
"apiAccessPoint": "https://api.na2.echosign.com/",
"webAccessPoint": "https://secure.na2.echosign.com/"
}
然后使用上面获得的apiAccessPoint进行API调用,以创建具有适当请求主体的新webhook。
<apiAccessPoint>api/rest/v6/webhooks
For example - https://api.na2.echosign.com/api/rest/v6/webhooks
您也可以参考Adobe Sign API文档。