I want to know how can I get a signed document from docusign API? I can already do a signture request via email (it works fine!). But I want that when a document is completed to show it on url click.
The documentation is not very clear...
Here a part of my php code:
try
{
//*** STEP 1 - Login API: get first Account ID and baseURL
//..............//
if(isset($loginInformation) && count($loginInformation) > 0)
{
$loginAccount = $loginInformation->getLoginAccounts()[0];
$host = $loginAccount->getBaseUrl();
$host = explode("/v2",$host);
$host = $host[0];
// UPDATE configuration object
$config->setHost($host);
// instantiate a NEW docusign api client (that has the correct baseUrl/host)
$apiClient = new DocuSign\eSign\ApiClient($config);
if(isset($loginInformation))
{
$accountId = $loginAccount->getAccountId();
if(!empty($accountId))
{
$envelopeApi = new DocuSign\eSign\Api\EnvelopesApi($apiClient);
$docsList = $envelopeApi->listDocuments($accountId, $envelopeId);
$documents = $docsList->getEnvelopeDocuments();
foreach($documents as $index => $document)
{
$url = $config->getHost().'/v2/accounts/'.$accountId.'/'.$document->getUri();
//------>Here i get the url but i cant read this file???
}
}
}
}
}
This url doesn't response, what am I doing wrong?