【发布时间】:2022-01-13 08:38:57
【问题描述】:
如何实现docusign嵌入式签名(REST API PHP)以创建带有json正文/格式的模板角色、选项卡和事件通知(用于获取签名状态的webhook)的信封?如何获得签名状态?
【问题讨论】:
标签: docusignapi webhooks
如何实现docusign嵌入式签名(REST API PHP)以创建带有json正文/格式的模板角色、选项卡和事件通知(用于获取签名状态的webhook)的信封?如何获得签名状态?
【问题讨论】:
标签: docusignapi webhooks
这是从博客post on this topic 中获取的一些代码 为此,您将需要 DocuSign.eSign PHP Package (PHP SDK)。
$envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition();
$eventNotification = new \DocuSign\eSign\Model\EventNotification();
# Set up the endpoint URL to call (it must be using HTTPS and at least TLS1.1 or higher)
$eventNotification->setUrl('https:\\myapp.somedomain.com');
# DocuSign will retry on failure if this is set
$eventNotification->setRequireAcknowledgment('true');
# This would send the documents together with the event to the endpoint
$eventNotification->setIncludeDocuments('true');
# Allows you to see this in the DocuSign Admin Connect logs section
$eventNotification->setLoggingEnabled('true');
$envelopeEvents = [];
# In this case we only add a single envelope event, when the envelope is completed. You can also add events for recipients
$envelopeEvent = new \DocuSign\eSign\Model\EnvelopeEvent();
$envelopeEvent->setEnvelopeEventStatusCode('completed'),
$envelopeEvent->setIncludeDocuments('true');
array_push($envelopeEvents, $envelopeEvent);
$eventNotification->setEnvelopeEvents($envelopeEvents);
$envelopeDefinition->setEventNotification($eventNotification);
【讨论】: