eventNotification XML结构
我将在docusign rest api v2第93页中的“发送信封或创建信封草稿”之后发送一份文档以供签名 文档已发送并签名,但我的事件通知功能有问题 我对这个特性的xml结构有点困惑。我试过很多不同的组合,但我想不出来。有什么帮助吗 这是我尝试过的众多方法之一eventNotification XML结构,xml,envelope,docusignapi,Xml,Envelope,Docusignapi,我将在docusign rest api v2第93页中的“发送信封或创建信封草稿”之后发送一份文档以供签名 文档已发送并签名,但我的事件通知功能有问题 我对这个特性的xml结构有点困惑。我试过很多不同的组合,但我想不出来。有什么帮助吗 这是我尝试过的众多方法之一 <eventNotification> <url>xxxxxx</url> <includeDocuments>false</includeDocuments>
<eventNotification>
<url>xxxxxx</url>
<includeDocuments>false</includeDocuments>
<loggingEnabled>true</loggingEnabled>
<envelopeEvents>
<envelopeEvent>
<envelopeEventStatusCode>completed</envelopeEventStatusCode>
</envelopeEvent>
</envelopeEvents>
</eventNotification>
xxxxxx
假的
真的
完整的
尽管从技术上讲,DocuSign REST API支持XML格式和JSON格式,但大部分DocuSign REST API文档、代码示例和开发人员资源都是JSON格式的。不幸的是,这意味着尝试将XML格式与DocuSign REST API结合使用(以完成非常基本的任务之外的任何事情)可能会非常令人沮丧——因为当您的XML请求不能按预期工作时,您几乎没有资源来确定正确的格式
为此,我建议您考虑使用JOSON REST API使用JSON而不是XML。下面是一个成功创建信封通知的JSON请求
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"roleName": "Signer1",
"name": "John Doe",
"email": "johnsemail@outlook.com"
}
],
"eventNotification": {
"url": "http://www.google.com",
"loggingEnabled": "true",
"requireAcknowledgement": "true",
"includeDocuments" : "false",
"envelopeEvents" : [{
"envelopeEventStatusCode" : "completed"
}]
},
"status": "sent"
}
更新:使用下面Ergin提供的信息,我能够使用XML实现这一点——关键是在EnvelopeEvents元素中对“信封”和“事件”都使用大写。以下是成功触发连接通知的请求示例:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>ACCOUNT_ID</accountId>
<status>sent</status>
<templateId>TEMPLATE_ID</templateId>
<templateRoles>
<templateRole>
<email>johnsemail@outlook.com</email>
<name>John Doe</name>
<roleName>Signer1</roleName>
</templateRole>
</templateRoles>
<eventNotification>
<EnvelopeEvents>
<envelopeEvent>
<envelopeEventStatusCode>completed</envelopeEventStatusCode>
</envelopeEvent>
</EnvelopeEvents>
<includeDocuments>false</includeDocuments>
<loggingEnabled>true</loggingEnabled>
<requireAcknowledgement>true</requireAcknowledgement>
<url>http://www.google.com</url>
</eventNotification>
</envelopeDefinition>
POST https://{{{env}}.docusign.net/restapi/{{{version}}/accounts/{{acctId}/envelopes
帐号
发送
模板ID
johnsemail@outlook.com
无名氏
签字人1
完整的
假的
真的
真的
http://www.google.com
尽管从技术上讲,DocuSign REST API支持XML格式和JSON格式,但大部分DocuSign REST API文档、代码示例和开发人员资源都是JSON格式的。不幸的是,这意味着尝试将XML格式与DocuSign REST API结合使用(以完成非常基本的任务之外的任何事情)可能会非常令人沮丧——因为当您的XML请求不能按预期工作时,您几乎没有资源来确定正确的格式
为此,我建议您考虑使用JOSON REST API使用JSON而不是XML。下面是一个成功创建信封通知的JSON请求
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"roleName": "Signer1",
"name": "John Doe",
"email": "johnsemail@outlook.com"
}
],
"eventNotification": {
"url": "http://www.google.com",
"loggingEnabled": "true",
"requireAcknowledgement": "true",
"includeDocuments" : "false",
"envelopeEvents" : [{
"envelopeEventStatusCode" : "completed"
}]
},
"status": "sent"
}
更新:使用下面Ergin提供的信息,我能够使用XML实现这一点——关键是在EnvelopeEvents元素中对“信封”和“事件”都使用大写。以下是成功触发连接通知的请求示例:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>ACCOUNT_ID</accountId>
<status>sent</status>
<templateId>TEMPLATE_ID</templateId>
<templateRoles>
<templateRole>
<email>johnsemail@outlook.com</email>
<name>John Doe</name>
<roleName>Signer1</roleName>
</templateRole>
</templateRoles>
<eventNotification>
<EnvelopeEvents>
<envelopeEvent>
<envelopeEventStatusCode>completed</envelopeEventStatusCode>
</envelopeEvent>
</EnvelopeEvents>
<includeDocuments>false</includeDocuments>
<loggingEnabled>true</loggingEnabled>
<requireAcknowledgement>true</requireAcknowledgement>
<url>http://www.google.com</url>
</eventNotification>
</envelopeDefinition>
POST https://{{{env}}.docusign.net/restapi/{{{version}}/accounts/{{acctId}/envelopes
帐号
发送
模板ID
johnsemail@outlook.com
无名氏
签字人1
完整的
假的
真的
真的
http://www.google.com
Kim的观点是正确的,DocuSign目前没有XML格式请求主体的良好文档。然而,有时由于技术限制、您不想重新编写解析代码或其他原因,JSON不是一个选项,开发人员只能使用XML格式
话虽如此,下面是eventNotifications对象的正确XML格式,以及您可以在其上设置的所有可能属性:
<eventNotification>
<EnvelopeEvents>
<envelopeEvent>
<envelopeEventStatusCode>sample string 1</envelopeEventStatusCode>
<includeDocuments>sample string 2</includeDocuments>
</envelopeEvent>
<envelopeEvent>
<envelopeEventStatusCode>sample string 1</envelopeEventStatusCode>
<includeDocuments>sample string 2</includeDocuments>
</envelopeEvent>
</EnvelopeEvents>
<includeCertificateWithSoap>sample string 6</includeCertificateWithSoap>
<includeDocuments>sample string 8</includeDocuments>
<includeEnvelopeVoidReason>sample string 9</includeEnvelopeVoidReason>
<includeSenderAccountAsCustomField>sample string 11</includeSenderAccountAsCustomField>
<includeTimeZone>sample string 10</includeTimeZone>
<loggingEnabled>sample string 2</loggingEnabled>
<recipientEvents>
<recipientEvent>
<includeDocuments>sample string 2</includeDocuments>
<recipientEventStatusCode>sample string 1</recipientEventStatusCode>
</recipientEvent>
<recipientEvent>
<includeDocuments>sample string 2</includeDocuments>
<recipientEventStatusCode>sample string 1</recipientEventStatusCode>
</recipientEvent>
</recipientEvents>
<requireAcknowledgment>sample string 3</requireAcknowledgment>
<signMessageWithX509Cert>sample string 7</signMessageWithX509Cert>
<soapNameSpace>sample string 5</soapNameSpace>
<url>sample string 1</url>
<useSoapInterface>sample string 4</useSoapInterface>
</eventNotification>
示例字符串1
样本串2
示例字符串1
样本串2
样本串6
样本串8
样本串9
样本串11
样本串10
样本串2
样本串2
示例字符串1
样本串2
示例字符串1
样本串3
样本串7
样本串5
示例字符串1
样本串4
Kim的观点是正确的,DocuSign目前没有XML格式请求主体的良好文档。然而,有时由于技术限制、您不想重新编写解析代码或其他原因,JSON不是一个选项,开发人员只能使用XML格式
话虽如此,下面是eventNotifications对象的正确XML格式,以及您可以在其上设置的所有可能属性:
<eventNotification>
<EnvelopeEvents>
<envelopeEvent>
<envelopeEventStatusCode>sample string 1</envelopeEventStatusCode>
<includeDocuments>sample string 2</includeDocuments>
</envelopeEvent>
<envelopeEvent>
<envelopeEventStatusCode>sample string 1</envelopeEventStatusCode>
<includeDocuments>sample string 2</includeDocuments>
</envelopeEvent>
</EnvelopeEvents>
<includeCertificateWithSoap>sample string 6</includeCertificateWithSoap>
<includeDocuments>sample string 8</includeDocuments>
<includeEnvelopeVoidReason>sample string 9</includeEnvelopeVoidReason>
<includeSenderAccountAsCustomField>sample string 11</includeSenderAccountAsCustomField>
<includeTimeZone>sample string 10</includeTimeZone>
<loggingEnabled>sample string 2</loggingEnabled>
<recipientEvents>
<recipientEvent>
<includeDocuments>sample string 2</includeDocuments>
<recipientEventStatusCode>sample string 1</recipientEventStatusCode>
</recipientEvent>
<recipientEvent>
<includeDocuments>sample string 2</includeDocuments>
<recipientEventStatusCode>sample string 1</recipientEventStatusCode>
</recipientEvent>
</recipientEvents>
<requireAcknowledgment>sample string 3</requireAcknowledgment>
<signMessageWithX509Cert>sample string 7</signMessageWithX509Cert>
<soapNameSpace>sample string 5</soapNameSpace>
<url>sample string 1</url>
<useSoapInterface>sample string 4</useSoapInterface>
</eventNotification>
示例字符串1
样本串2
示例字符串1
样本串2
样本串6
样本串8
样本串9
样本串11
样本串10
样本串2
样本串2
示例字符串1
样本串2
示例字符串1
样本串3
样本串7
样本串5
示例字符串1
样本串4
我不想在代码中使用json和xml,也不想将所有xml代码都转换为json。我要等着看是否有人知道答案。我知道json有更多的示例,但我认为它们需要记录xml结构。他们所有的JavaAPI演练都使用xml…是的,顺便说一句,“演练”示例是您可以在RESTAPI中找到xml格式示例的唯一地方。不幸的是,演练仅说明了非常基本的场景,请求中使用了最少的参数(元素)。完全同意DocuSign使用REST实际记录XML的完整请求/响应结构是非常好的。祝你好运我不想在代码中使用json和xml,也不想将所有xml代码都转换为json。我要等着看是否有人知道答案。我知道json有更多的例子,但我认为它们需要文档化