嵌入式签名视图文档返回 404



我正在尝试让嵌入式签名视图重定向我的用户,以便他们可以对文档进行签名。每次我提出请求时,我都会收到一个没有消息的 404。除了 HTTP 代码之外,响应没有任何内容。发送信封工作完全正常,每次尝试测试时我都会收到一封电子邮件。

$data = json_encode(array(
"returnUrl" => base_url() . "dashboard/home",
"authenticationMethod" => "email",
"email" => $this->userEmail,
"userName" => "seller",
"clientUserId" => $this->user,
'recipientId' => '1'
));

$ch = curl_init($this->baseUrl . "/envelope/$this->envelopeId/views/recipient");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data),
'X-DocuSign-Authentication: ' . $this->header
)
);
$resp = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$headers = curl_getinfo($ch, CURLINFO_HEADER_OUT);
if ($status != 201) {
error_log($resp);
die();
}
$response = json_decode($resp, true);
return $response['url'];

我已经遵循了 Docusign 文档中的示例,甚至在另一部分中使用它,这只是使用复合模板。我尝试搜索返回 404 的嵌入式签名,但一无所获。我会附上错误消息,但它给出的只是它收到 404。提前谢谢你!

信封拼写错误

$ch = curl_init($this->baseUrl . "/envelope/$this->envelopeId/views/recipient");

应该是

$ch = curl_init($this->baseUrl . "/envelopes/$this->envelopeId/views/recipient");

EnvelopeViews:createRecipient 的 url 应采用以下格式。

POST/v2/accounts/{accountId}/envelopes/{envelopeId}/views/recipient

例如,如果您使用的是沙盒环境,则必须对以下 URL 进行 HTTP POST

https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/views/recipient

最新更新