向 DocuSign 信封添加自定义属性

泰勒·罗珀

问题:

如何user_id向 DocuSign 信封添加自定义属性,以便在收到来自 DocuSign 的回调时,可以检索关联的user_id? (在 VB.Net 中)

我已经阅读了关于Custom Fields的文档,尽管这似乎是我在管理面板中的模板上创建它们 - 如果可能的话,我宁愿在代码中动态创建它们。尽管如此,我已经尝试使用这种方法(未成功)。代码包含在下面。


我试过的

手动设置 EnvelopeID:

envDef.EnvelopeId = app_Id

EnvelopID 被 DocuSign 的自动生成的 GUID 覆盖

创建自定义字段:

(创建User_ID在管理面板中命名的 Text CustomField 之后...)

Dim user_id_field As New TextCustomField()
user_id_field.Name = "User_ID"
user_id_field.Value = user_id

Dim custom_fields As New CustomFields()
custom_fields.TextCustomFields.Add(user_id_field)

envDef.CustomFields = custom_fields

DocuSign XML 负载中完全没有自定义字段


最后一招:

我可以创建一个关联表,将 DocuSign 的EnvelopeIDGUID 与user_id创建信封的时间相关联然后我可以使用EnvelopeID来查找user_id回调。


我的代码:

下面的代码运行良好。用户接收文档,签署文档,我们在文档发送和文档完成都会收到回调当然,缺少的部分是将 DocuSign 传递给我的自定义属性。

(为简洁起见,我排除了很多信息,如角色、模板等。)

Dim envDef As New EnvelopeDefinition()

Dim envelope_events As New List(Of EnvelopeEvent)
envelope_events.Add(New EnvelopeEvent("sent", True))
envelope_events.Add(New EnvelopeEvent("completed", True))

Dim recipient_events As New List(Of RecipientEvent)
recipient_events.Add(New RecipientEvent(True, "Sent"))
recipient_events.Add(New RecipientEvent(True, "Completed"))
recipient_events.Add(New RecipientEvent(True, "AuthenticationFailed"))

Dim notification As New EventNotification
' -- Notification properties excluded for brevity --

notification.EnvelopeEvents = envelope_events
notification.RecipientEvents = recipient_events

envDef.EventNotification = notification

Dim apiClient As New ApiClient("https://demo.docusign.net/restapi")
Dim cfi As New Configuration(apiClient)
Dim authHeader As String = "{""Username"":""" + userName + """, ""Password"":""" + password + """, ""IntegratorKey"":""" + INTEGRATOR_KEY + """}"
cfi.AddDefaultHeader("X-DocuSign-Authentication", authHeader)

Dim envelopesApi As New EnvelopesApi(cfi)
Dim envelopeSummary As EnvelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef)
雷迪

您不必总是在管理面板中创建自定义字段。您可以在通过 API 创建信封期间动态指定自定义字段。

以下应该工作。此处查看完整代码

        Dim envDef = New EnvelopeDefinition()
        envDef.EmailSubject = "[DocuSign C# SDK] - Custom Fields"
        envDef.Status = "sent"


        envDef.CustomFields = New CustomFields()

        Dim textCustomField = New TextCustomField()
        textCustomField.Name = "User_Id"
        textCustomField.Value = "KTI456"

        Dim textCustomFields = New List(Of TextCustomField)()
        textCustomFields.Add(textCustomField)
        envDef.CustomFields.TextCustomFields = textCustomFields

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

向openldap添加自定义属性

来自分类Dev

向openldap添加自定义属性

来自分类Dev

使用自定义字段创建DocuSign信封

来自分类Dev

使用Docusign REST API的自定义信封字段

来自分类Dev

Wordpress Woocommerce 向产品添加属性/自定义属性

来自分类Dev

如何通过API向Docusign模板添加表格?

来自分类Dev

向fabricjs对象添加自定义属性

来自分类Dev

XMPPFramework-如何向XMPPUserCoreDataStorageObject添加自定义属性?

来自分类Dev

向vue.js组件添加自定义属性

来自分类Dev

如何向标准 HTML 元素添加自定义属性?

来自分类Dev

向 CF Wheels 表单添加自定义 HTML 属性

来自分类Dev

如何向 Paperjs 对象添加自定义属性?

来自分类Dev

向控件添加自定义本地属性?

来自分类Dev

是否可以向边缘添加自定义属性?

来自分类Dev

向故障实体添加自定义属性

来自分类Dev

使用Docusign API的信封上未显示自定义列表字段

来自分类Dev

向基础添加自定义样式

来自分类Dev

向lodash添加自定义函数

来自分类Dev

向自定义控件添加功能

来自分类Dev

向django添加自定义语言

来自分类Dev

向fontconfig添加自定义字体

来自分类Dev

向openldap添加自定义架构

来自分类Dev

向基础添加自定义样式

来自分类Dev

向 matIconRegistry 添加自定义图标?

来自分类Dev

Docusign 访问码验证 - Docusign 中的自定义消息

来自分类Dev

Yii cgridview从数据不起作用向按钮添加自定义html属性

来自分类Dev

如何在magento2中向运输方法添加自定义属性

来自分类Dev

在上传过程中向GridFS Meteor FS文件添加自定义属性

来自分类Dev

react bootstrap-向按钮添加自定义bsStyle属性