Docusign批量发送使用PHP客户端

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (1)
  • 关注 (0)
  • 查看 (24)

我使用docusign php客户端实现了批量发送。我收到以下错误消息

{“errorCode”:“UNSPECIFIED_ERROR”,“message”:“值不能为null。参数名称: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 ----------

任何帮助赞赏。提前致谢

提问于

扫码关注云+社区

领取腾讯云代金券