dsa88886666
2018-05-30 13:19
浏览 47
已采纳

Docu Sign Rest Api集成生产得到ACCOUNT_LACKS_PERMISSIONS错误

Note : Code is working fine with demo account , but we are getting error with production account .

I sent document for online signature by using Rest Api on docusign URL : https://www.docusign.net/restApi/v2. AND Try to create envelope id for that documents. But now i am getting error like .

stdClass Object
(
    [errorCode] => ACCOUNT_LACKS_PERMISSIONS
    [message] => This Account lacks sufficient permissions.
)

I have configured all the required key for production account

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;
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题