Получите черновик конверта с данными - PullRequest
0 голосов
/ 09 марта 2020

Как получить черновик конверта с данными в полях формы через REST API для предварительного просмотра в моей системе, я использую PHP API в песочнице DocuSign, но запрос PDF-ответ с ошибкой при конверте Идентификатор в черновом состоянии.

 <?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://demo.docusign.net/restapi/v2.1/accounts/7808658/envelopes/{{envelopeId}}/documents/{{documentId}}');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'X-DocuSign-Authentication' => '{"Username":"x@xxx.com","Password":"doOTcFj08wl/xO6uR2ZLX6+rOaE=","IntegratorKey": "xxxx-xxxx-xx-a075-xxx"}',
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

Я попытался сделать запрос на почтальона, но ответ, если конверт находится в черновом состоянии, является ошибкой.

1 Ответ

0 голосов
/ 19 марта 2020
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://demo.docusign.net/restapi/v2.1/accounts/7808658/envelopes/{{envelopeId}}/documents/{{documentId}}');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
  'X-DocuSign-Authentication' => '{"Username":"x@xxx.com","Password":"doOTcFj08wl/xO6uR2ZLX6+rOaE=","IntegratorKey": "xxxx-xxxx-xx-a075-xxx"}',
  'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

Если вы выводите / отлаживаете эту строку 'https://demo.docusign.net/restapi/v2.1/accounts/7808658/envelopes/{{envelopeId}}/documents/{{documentId}}'

Вы заметите, что вы не передали envelopeId или documentId, вместо этого вы передаете их как текст, пожалуйста, передайте envelopeID и documentID и API должны работать нормально

...