user_id
DocuSign 엔벨로프 와 같은 사용자 지정 속성을 어떻게 추가하여 DocuSign에서 콜백을받을 때 관련 user_id
? (VB.Net에서)
사용자 정의 필드 에 대한 설명서를 읽었 지만 관리자 패널의 템플릿에서 생성하는 것처럼 보이지만 가능하면 코드에서 동적으로 생성하고 싶습니다. 그럼에도 불구하고 나는이 방법을 사용하려고 시도했습니다 (실패했습니다). 코드는 아래에 포함되어 있습니다.
수동으로 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의 EnvelopeID
GUID를 user_id
봉투를 만들 때 와 관련시키는 연결 테이블을 만들 수 있습니다 . 그런 다음을 사용하여 콜백 EnvelopeID
을 조회 할 수 있습니다 user_id
.
아래 코드는 잘 작동합니다. 사용자는 문서를 받고 서명하면 문서가 Sent 일 때와 문서가 Completed 일 때 콜백을받습니다 . 물론 누락 된 부분은 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] 삭제
몇 마디 만하겠습니다