Массовая отправка Docusign с использованием php клиента - PullRequest
2 голосов
/ 07 мая 2019

Я реализовал массовую отправку с использованием PHP-клиента docusign.Я получаю следующее сообщение об ошибке

{"errorCode": "UNSPECIFIED_ERROR", "message": "Значение не может быть пустым. Имя параметра: stream"}

когда я бегу ниже исходного кода.

$templateId = 'd756f973-...';
$apiClient  = $this->getDocuSignClient();

// Get Template
$templatesApi = new TemplatesApi($apiClient);
$templateDetails = $templatesApi->get($this->getAccountId(), $templateId);

// Set documents
...

// Receipient
$signer = new Signer();
$signer->setIsBulkRecipient('true');
$signer->setRecipientId('1');

$recipients = new Recipients();
$recipients->setSigners([$signer]);

// Create draft template

$envelopDefinition = new EnvelopeDefinition();
$envelopDefinition->setStatus('created');
$envelopDefinition->setDocuments($documents);
$envelopDefinition->setRecipients($recipients);
$envelopDefinition->setEmailSubject('Sign bulk send');

$envelopeApi = new EnvelopesApi($apiClient);
$envelopSummary = $envelopeApi->createEnvelope($this->getAccountId(), $envelopDefinition);

// Update bulk recipients

$clients = Client::all();
$bulkRecipients = [];

foreach ($clients as $client) {
    $bulkRecipient = new BulkRecipient();
    $bulkRecipient->setEmail($client->email);
    $bulkRecipient->setName($client->first_name);

    $bulkRecipients[] = $bulkRecipient;
}

$bulkRequest = new BulkRecipientsRequest();
$bulkRequest->setBulkRecipients($bulkRecipients);

$bulkEnvelopesApi = new BulkEnvelopesApi($apiClient);
$bulkEnvelopesApi->updateRecipients($this->getAccountId(), $envelopSummary['envelope_id'], '1', $bulkRequest);
// ---------- the error message throws on above line ----------

Любая помощь приветствуется.Заранее спасибо

1 Ответ

0 голосов
/ 08 июля 2019

Вы можете попробовать обновить до версии 4 (https://github.com/docusign/docusign-php-client/releases/tag/v4.0.0) клиента PHP). Это поддерживает наш новый API v2.1, который имеет значительно улучшенную поддержку массовой отправки https://developers.docusign.com/esign-rest-api/reference/BulkEnvelopes/BulkEnvelopes/

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...