我正在嘗試在我正在構建的網站上爲用戶使用嵌入式簽名。和錯誤我一直(從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