Docusignapi 完成docusign后无法获取webhook数据
我已将用于签名的文档从本地实例发送给使用此代码的签名者Docusignapi 完成docusign后无法获取webhook数据,docusignapi,Docusignapi,我已将用于签名的文档从本地实例发送给使用此代码的签名者 print_r(send_document_for_signing()); function send_document_for_signing(){ # The document $fileNamePath will be sent to be signed by <signer_name> # Settings # Fill in these constants # # Obtain
print_r(send_document_for_signing());
function send_document_for_signing(){
# The document $fileNamePath will be sent to be signed by <signer_name>
# Settings
# Fill in these constants
#
# Obtain an OAuth access token from https://developers.docusign.com/oauth-token-generator
$accessToken = 'myAccessTokes';
# Obtain your accountId from demo.docusign.com -- the account id is shown in the drop down on the
# upper right corner of the screen by your picture or the default picture.
$accountId = '';
# Recipient Information:
$signerName = '';
$signerEmail = '';
# The document you wish to send. Path is relative to the root directory of this repo.
$fileNamePath = 'test/Docs/SignTest1.pdf';
# The API base_path
$basePath = 'https://demo.docusign.net/restapi';
# Constants
$appPath = getcwd();
#
# Step 1. The envelope definition is created.
# One signHere tab is added.
# The document path supplied is relative to the working directory
#
# Create the component objects for the envelope definition...
$contentBytes = file_get_contents($appPath . "/" . $fileNamePath);
$base64FileContent = base64_encode ($contentBytes);
$document = new DocuSign\eSign\Model\Document([ # create the DocuSign document object
'document_base64' => $base64FileContent,
'name' => 'Example document', # can be different from actual file name
'file_extension' => 'pdf', # many different document types are accepted
'document_id' => '1' # a label used to reference the doc
]);
$envelope_events = [
(new \DocuSign\eSign\Model\EnvelopeEvent())->setEnvelopeEventStatusCode("sent"),
];
$recipient_events = [
(new \DocuSign\eSign\Model\RecipientEvent())->setRecipientEventStatusCode("Completed"),
];
$event_notification = new \DocuSign\eSign\Model\EventNotification();
$event_notification->setUrl('mysite/docusign_test/test.php');
$event_notification->setLoggingEnabled("true");
$event_notification->setRequireAcknowledgment("true");
$event_notification->setUseSoapInterface("false");
$event_notification->setIncludeCertificateWithSoap("false");
$event_notification->setSignMessageWithX509Cert("false");
$event_notification->setIncludeDocuments("true");
$event_notification->setIncludeEnvelopeVoidReason("true");
$event_notification->setIncludeTimeZone("true");
$event_notification->setIncludeSenderAccountAsCustomField("true");
$event_notification->setIncludeDocumentFields("true");
$event_notification->setIncludeCertificateOfCompletion("true");
$event_notification->setEnvelopeEvents($envelope_events);
$event_notification->setRecipientEvents($recipient_events);
# The signer object
$signer = new DocuSign\eSign\Model\Signer([
'email' => $signerEmail, 'name' => $signerName, 'recipient_id' => "1", 'routing_order' => "1"
]);
# Next, create the top level envelope definition and populate it.
$envelopeDefinition = new DocuSign\eSign\Model\EnvelopeDefinition([
'email_subject' => "Please sign this document",
'documents' => [$document], # The order in the docs array determines the order in the envelope
'recipients' => new DocuSign\eSign\Model\Recipients(['signers' => [$signer]]), # The Recipients object wants arrays for each recipient type
'status' => "sent", # requests that the envelope be created and sent.
]);
$envelopeDefinition->setEventNotification($event_notification);
#
# Step 2. Create/send the envelope.
#
$config = new DocuSign\eSign\Configuration();
$config->setHost($basePath);
$config->addDefaultHeader("Authorization", "Bearer " . $accessToken);
$apiClient = new DocuSign\eSign\Client\ApiClient($config);
$envelopeApi = new DocuSign\eSign\Api\EnvelopesApi($apiClient);
$results = $envelopeApi->createEnvelope($accountId, $envelopeDefinition);
return $results;
您用于webhook的url是什么? 有一种方法可以检查连接日志,查看是否有人试图调用您的代码,以及它是否正常工作。这将允许您进一步隔离问题(您还可以使用调试技术确认您的代码已被调用)
请参见此处-有关连接日志的信息您用于webhook的url是什么? 有一种方法可以检查连接日志,查看是否有人试图调用您的代码,以及它是否正常工作。这将允许您进一步隔离问题(您还可以使用调试技术确认您的代码已被调用)
请参见此处-有关连接日志的信息,EventNotifications的URL必须使用HTTPS进行保护。如果您使用的是
http://{url}/
,它将失败。事件通知的url必须使用HTTPS进行保护。如果您使用的是http://{url}/
它将失败。您好,谢谢您的评论。实际上,我没有使用connectapi。而是事件通知
数组中的一个简单的webhookurl
。更多关于我使用的http://{someip}/test.php
噢,你说的是重定向URL?它会回到你的应用程序中吗?但是没有额外的信息吗?我说的是这个$event_notification->setUrl('mysite/docusign_test/test.php')代码>,完成后返回信封详细信息。这是连接。但是你说你没有使用连接。所以我很困惑。您似乎正在使用connect.problem是在https中出现的,没有https就无法正常工作。谢谢您提供的帮助。您好,谢谢您的评论。实际上,我没有使用connectapi。而是事件通知
数组中的一个简单的webhookurl
。更多关于我使用的http://{someip}/test.php
噢,你说的是重定向URL?它会回到你的应用程序中吗?但是没有额外的信息吗?我说的是这个$event_notification->setUrl('mysite/docusign_test/test.php')代码>,完成后返回信封详细信息。这是连接。但是你说你没有使用连接。所以我很困惑。您似乎正在使用connect.problem是在https中,没有https它就无法工作。谢谢您提供了很多帮助。如果我添加了https服务器,并且能够得到响应,它就会工作。非常感谢。我有一个问题,是否可以禁用安全url?我的意思是我只能使用http吗?不,HTTPS是强制性的。这里有更多信息:如果我添加了https服务器,我就可以得到我的响应。非常感谢。我有一个问题,是否可以禁用安全url?我的意思是我只能使用http吗?不,HTTPS是强制性的。有关更多信息,请访问:
<?php
$data = file_get_contents('php://input');
file_put_contents('data.txt', $data);
?>