我试图创建一个脚本来从一个帐户下载所有文档进行归档,但是在使用DocuSign的PHP SDK创建APIClient实例时遇到了问题。
我遇到的错误是:
Class 'DocuSign\eSign\ApiClient' not found in PATH_TO_SDK:22 Stack trace: #0 {main} thrown in PATH_TO_PROJECT\index.php
那我将如何连接到新定位的APIClient?
我在sdk文件夹中搜索了它,发现了这个问题:
[4.0.0]-eSignature API v19.1.02-2019-06-07 打破 -将ApiClient和ApiException移到了Client文件夹下
$username = "__email__";
$password = "__password__";
$integrator_key = "__integrator_key__";
$host = "https://demo.docusign.net/restapi";
$config = new DocuSign\eSign\Configuration();
$config->setHost($host);
$config->setSSLVerification(false);
$config->addDefaultHeader("X-DocuSign-Authentication", "{\"Username\":\"" . $username . "\",\"Password\":\"" . $password . "\",\"IntegratorKey\":\"" . $integrator_key . "\"}");
$apiClient = new DocuSign\eSign\ApiClient($config);
$authenticationApi = new DocuSign\eSign\Api\AuthenticationApi($apiClient);
$options = new \DocuSign\eSign\Api\AuthenticationApi\LoginOptions();```
答案 0 :(得分:1)
浏览“ vendor”文件夹后,我发现用于此目的的命名空间和“ DocuSign \ eSign \ ApiClient($ config)”需要更改为“ DocuSign \ eSign \ client \ ApiClient($ config)”。