1
我試圖信封發送給用戶,像這樣:能夠使用的DocuSign PHP SDK進行身份驗證,但createEnvelope方法失敗(「[400]錯誤連接到API」)
$envelope_status = $this->envelopeApi->createEnvelope($this->accountId, $envelope, null);
,但我得到這個錯誤:
Exception: exception 'DocuSign\eSign\ApiException' with message '[400] Error connecting to the API (https://demo.docusign.net/restapi/v2/accounts/1687539/envelopes)' in /srv/www/vhosts/redacted/pages/test/docusign/sdk/docusign-php-client-master/src/ApiClient.php:250
請注意,我能夠成功地輪詢我的帳戶ID的API有成功後登錄,所以這個問題必須在別處。我將一個鏈接附加到$信封here的var_dump()。我懷疑我必須搞亂製作信封的步驟之一。
謝謝!
編輯:供參考這是我搞亂了。當$指數== 0,setDocumentId()會失敗 - 文檔ID爲1
function addDocument($fileTitle, $fileContent)
{
$index = count($this->documents);
$this->documents[$index] = new DocuSign\eSign\Model\Document();
$this->documents[$index]->setDocumentBase64(base64_encode($fileContent));
$this->documents[$index]->setName($fileTitle);
$this->documents[$index]->setDocumentId($index + 1);
return json_encode($this->documents[$index]);
}
你可以告訴我的代碼片段,你設置documentID爲1而不是0? – PhpCoder
我編輯了問題並添加了該片段。 – NilsonCain