Get document url

2019-08-13 16:27发布

When I get document by envelope id:

$testConfig=new \DocuSign\eSign\ApiClient($config);
$envelopeApi = new \DocuSign\eSign\Api\EnvelopesApi($testConfig);
$docsList = $envelopeApi->listDocuments($accountId, "4f4ec572-b7aa-4b42-96ed-3e85655efbaa");
//var_dump($docsList->getUrl()); 
//$this->assertNotEmpty($docsList);
//$this->assertNotEmpty($docsList->getEnvelopeId());
$docCount = count($docsList->getEnvelopeDocuments());
if (intval($docCount) > 0)
{
    foreach($docsList->getEnvelopeDocuments() as $document)
    {
        print_r($document);
        //$file = $envelopeApi->getDocument($testConfig->getAccountId(), $testConfig->getEnvelopeId(), $document->getDocumentId());
        //$this->assertNotEmpty($file);
    }
}

I get the following response.

But what is root domain for the returned url /envelopes/4f4ec572-b7aa-4b42-96ed-3e85655efbaa/documents/certificate?

DocuSign\eSign\Model\EnvelopeDocument Object
(
    [document_id:protected] => 1
    [name:protected] => MojDoc.pdf
    [type:protected] => content
    [uri:protected] => /envelopes/4f4ec572-b7aa-4b42-96ed-3e85655efbaa/documents/1
    [order:protected] => 1
    [pages:protected] => 2
    [contains_pdf_form_fields:protected] => 
    [available_document_types:protected] => Array
        (
            [0] => DocuSign\eSign\Model\SignatureType Object
                (
                    [type:protected] => electronic
                    [is_default:protected] => true
                )

        )

    [error_details:protected] => 
)
DocuSign\eSign\Model\EnvelopeDocument Object
(
    [document_id:protected] => certificate
    [name:protected] => Summary
    [type:protected] => summary
    [uri:protected] => /envelopes/4f4ec572-b7aa-4b42-96ed-3e85655efbaa/documents/certificate
    [order:protected] => 999
    [pages:protected] => 4
    [contains_pdf_form_fields:protected] => 
    [available_document_types:protected] => Array
        (
            [0] => DocuSign\eSign\Model\SignatureType Object
                (
                    [type:protected] => electronic
                    [is_default:protected] => true
                )

        )

    [error_details:protected] => 
)

标签: docusignapi
1条回答
forever°为你锁心
2楼-- · 2019-08-13 17:15

The urls are relative to the baseUrl for the account. You received the baseUrl when you did your initial /login_information call.

Note that it is not uncommon for the /login_information method to return multiple account information if the user has access to multiple accounts.

baseUrls are different for each account.

查看更多
登录 后发表回答