Get document url

一个人想着一个人 提交于 2020-01-05 04:25:08

问题


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] => 
)

回答1:


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.



来源:https://stackoverflow.com/questions/37212227/get-document-url

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!