获取文档网址

时间:2016-05-13 14:10:04

标签: docusignapi

当我通过信封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);
    }
}

我收到以下回复。

但返回的网址/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 个答案:

答案 0 :(得分:2)

网址与帐户的baseUrl相关。您在进行初始/login_information通话时收到了baseUrl。

请注意,如果用户有权访问多个帐户,则/ login_information方法返回多个帐户信息的情况并不少见。

每个帐户的baseUrls都不同。