注意:代码在模拟帐户中运行正常,但我们在生产帐户中遇到错误。
我在docusign网址上使用Rest Api发送了在线签名文档:https://www.docusign.net/restApi/v2。并尝试为该文档创建信封ID。但现在我得到的错误就像。
stdClass Object
(
[errorCode] => ACCOUNT_LACKS_PERMISSIONS
[message] => This Account lacks sufficient permissions.
)
我已为生产帐户配置了所有必需的密钥
DOCUSIGN_USERNAME=xxxxxxxxxxxxxxxxxxxxxx
DOCUSIGN_PASSWORD=xxxxxxxxxxxxxxxxxxxxxx
DOCUSIGN_ACCOUNTID=xxxxxxxxxxxxxxxxxxxxx
DOCUSIGN_KEY=xxxxxxxxxxxxxxxxxxxxxx
$documentBase64 = base64_encode(file_get_contents($input['url']));
$data = "{
'status': 'sent',
'emailSubject': 'Docusign - ".$input['document_name']."',
'documents': [{
'documentId': '12',
'name': '".$input['document_name']."',
'documentBase64': '$documentBase64',
}],
'recipients': {
'signers': [{
'email': '".$applicantEmail."',
'name': '".$applicantName."',
'recipientId': '1',
'clientUserId': '1989'
}]
}
}";
$url = env('DOCUSIGN_URL')."/accounts/".env('DOCUSIGN_ACCOUNTID')."/envelopes";
$header = "<DocuSignCredentials><Username>" . env('DOCUSIGN_USERNAME') . "</Username><Password>" . env('DOCUSIGN_PASSWORD') . "</Password><IntegratorKey>" . env('DOCUSIGN_KEY') . "</IntegratorKey></DocuSignCredentials>";
$ch = curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type: application/json', "X-DocuSign-Authentication: $header"));
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response);
echo "<pre>";print_r($response);die;
答案 0 :(得分:0)
您应该检查您的真实帐户是否启用了嵌入功能,否则您应该升级它。
答案 1 :(得分:0)
您必须设置以下基本网址之一,而不是https://www.docusign.net/restApi/v2
对于北美帐户持有人: - https://na2.docusign.net/restapi/v2/accounts/ {accountId} 对于欧洲的帐户持有人:https://eu.docusign.net/restapi/v2/accounts/ {accountId}
注意: - DocuSign托管多个经地理位置分散的ISO 27001认证和SSAE 16审核数据中心。有关详细信息,请转至https://docs.docusign.com/