Reputation: 51
I am trying to create a script to download all documents from an account for archiving but I am having problem creating the APIClient instance using the PHP SDK for DocuSign.
The error that I am presented with is :
Class 'DocuSign\eSign\ApiClient' not found in PATH_TO_SDK:22 Stack trace: #0 {main} thrown in PATH_TO_PROJECT\index.php
So how would I connect to the newly located APIClient?
I searched for it in the sdk folder and I came across this:
[4.0.0] - eSignature API v19.1.02 - 2019-06-07 BREAKING - Moved ApiClient and ApiException under Client folder
$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();```
Upvotes: 0
Views: 1299
Reputation: 51
After looking through the "vendor" folder I found the namespace being used for this and "DocuSign\eSign\ApiClient($config)" needs to be changed to "DocuSign\eSign\client\ApiClient($config)".
Upvotes: 2