我正在尝试在我正在构建的网站上为用户使用嵌入式签名。和错误我一直(从API浏览器,并通过自己的代码)得到的是:Docusign API - 嵌入式签名问题
“错误码”:“RECIPIENT_NOT_IN_SEQUENCE”, “消息”:“不能生成失序接收方的令牌“。
首先,我上传文件来创建一个信封,将一个收件人:
$data = array(
'accountId' => $accountId,
'documents' => array(
array(
'documentId' => '1',
'name' => 'document.pdf'
)
),
'recipients' => array(
'signers' => array(array(
array(
'tabs' => array(
'signHereTabs' => array(
array(
"pageNumber" => "1",
"documentId" => "1",
"yPosition" => "100",
"xPosition" => "100",
)
)
)
),
'routingOrder'=> '1',
'recipientId'=> '1',
'clientUserId'=> $clientUserId,
'name'=> 'Signer 1',
'email'=> '[email protected]'
))
)
);
$json_data = json_encode($data);
$file_contents =
file_get_contents("document.pdf");
$requestBody = "\r\n"
."\r\n"
."--myboundary\r\n"
."Content-Type: application/json\r\n"
."Content-Disposition: form-data\r\n"
."\r\n"
."$json_data\r\n"
."--myboundary\r\n"
."Content-Type:application/pdf\r\n"
."Content-Disposition: file; filename=\”document.pdf\"; documentid=1 \r\n"
."\r\n"
."$file_contents\r\n"
."--myboundary--\r\n"
."\r\n";
// *** append "/envelopes" to baseUrl and as signature request endpoint
$curl = curl_init($baseUrl . "/envelopes");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: multipart/form-data;boundary=myboundary',
'Content-Length: ' . strlen($requestBody),
"X-DocuSign-Authentication: $header")
);
然后我送它关闭让收件人地址的签名查看:
$data = array("returnUrl" => "http://quidfs.bfclients.com/dashboard",
"authenticationMethod" => "None",
"email" => '[email protected]',
"userName" => 'Signer 1',
"clientUserId" => $clientUserId,
);
$data_string = json_encode($data);
$curl = curl_init($baseUrl . "/envelopes/$envelopeId/views/recipient");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string),
"X-DocuSign-Authentication: $header")
);
有什么想法?提前致谢。
请张贴的'账户/ {}帐户ID结果/袋/ {} envelopeId/recipients',所以我们可以看到,'$ clientUserId'是通过的实际值 – Andrew 2014-09-05 20:01:02