Docusignapi 使用DocuSign.Integration.Client.dll v1.4,使用GetRecipientView获取信封的未授权帐户
登录时使用的是开发人员沙箱帐户。如果收件人的电子邮件与发件人登录帐户的电子邮件相同,则一切正常。但是,如果它们不同,则在调用ENVELOPE.GetRecipientView时会抛出剩余错误Docusignapi 使用DocuSign.Integration.Client.dll v1.4,使用GetRecipientView获取信封的未授权帐户,docusignapi,Docusignapi,登录时使用的是开发人员沙箱帐户。如果收件人的电子邮件与发件人登录帐户的电子邮件相同,则一切正常。但是,如果它们不同,则在调用ENVELOPE.GetRecipientView时会抛出剩余错误ACCOUNT NOT AUTHORIZED FOR ENVELOPE。信封已成功创建。下面是我的代码 Private Sub SendDocToSign(ByVal docPDF As Byte()) Dim clsQuote As New clsQuote Dim objDatabase As New
ACCOUNT NOT AUTHORIZED FOR ENVELOPE
。信封已成功创建。下面是我的代码
Private Sub SendDocToSign(ByVal docPDF As Byte())
Dim clsQuote As New clsQuote
Dim objDatabase As New clsDatabase
Try
' configure application's integrator key and webservice url
RestSettings.Instance.IntegratorKey = AppSettings("IntegratorsKey")
RestSettings.Instance.DocuSignAddress = "https://" & AppSettings("PAGE_DOCUSIGN")
RestSettings.Instance.WebServiceUrl = RestSettings.Instance.DocuSignAddress & "/restapi/v2"
RestSettings.Instance.FeatureSetId = "........"
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls Or System.Net.SecurityProtocolType.Ssl3
System.Net.ServicePointManager.Expect100Continue = False
' credentials for sending account
Dim account As Account = New Account()
account.Email = AppSettings("APIUserEmail")
account.Password = AppSettings("Password")
account.ApiPassword = AppSettings("Password")
account.Proxy = New System.Net.WebProxy("Proxy Server", True)
account.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
' make the Login API call
Dim result As Boolean = account.Login()
If result = False Then
Response.Write("Login Failed: " & result & " " & account.RestError.message)
Return
End If
Dim recipients As Recipients = New Recipients()
Dim signer As Signer = New Signer
signer.email = MyBase.pEmail
signer.name = MyBase.pContactName
signer.recipientId = "1"
signer.routingOrder = "1"
'signer.clientUserId = "1000"
Dim Signers(0) As Signer
Signers(0) = signer
recipients.signers = Signers
Dim tabs As New TabCollection()
Dim tab As New Tab()
tab.pageNumber = 3
tab.xPosition = 31
tab.yPosition = 382
tab.recipientId = "1"
tab.documentId = 1
tabs.signHereTabs.Add(tab)
Dim texttab As New TextTab()
texttab.pageNumber = 3
texttab.xPosition = 31
texttab.yPosition = 475
texttab.recipientId = "1"
texttab.documentId = 1
tabs.textTabs.Add(texttab)
Dim datetab As New DateSignedTab()
datetab.pageNumber = 3
datetab.xPosition = 480
datetab.yPosition = 417
datetab.recipientId = "1"
datetab.documentId = 1
tabs.dateSignedTabs.Add(datetab)
' create envelope object and assign login info
Dim envelope As New Envelope()
envelope.Login = account
' add one signer to the envelope
envelope.Recipients = recipients
' send the envelope immediately (otherwise set to "created" to save as draft envelope)
envelope.Status = "sent"
' email subject is required
envelope.EmailSubject = "Signature Request on Application"
Dim FileName = MyBase.pReferenceNum & AppSettings("PDF_FILE_EXT")
result = envelope.Create(docPDF, FileName)
If result = False Then
Response.Write("Envelope Creation Failed: " & result & " " & envelope.RestError.message)
Return
End If
result = envelope.GetRecipientView("afterDocuSign.aspx", True)
If result = False Then
Response.Write("GetRecipientView Failed: " & result & " " & envelope.RestError.message)
Return
End If
result = envelope.AddTabs(tabs)
If result = False Then
Response.Write("Tab addition failed: " & result & " " & envelope.RestError.message)
Return
End If
MyBase.pEnvelopeID = envelope.EnvelopeId
MyBase.SetQuoteSession()
clsQuote.Put_DocuSign_Rec(envelope.EnvelopeId, MyBase.pReferenceNum, envelope.Status)
Response.Redirect(envelope.SenderViewUrl)
Catch ex As Exception
Throw
End Try
End Sub
一些可能的原因:
- 检查从另一个帐户创建的信封(即,您只能在您发送的同一个帐户中看到信封,您是签名者,或者如果您是该帐户的管理员)
- 错误的环境-例如,您在生产(www)中创建了信封,但您正在检查开发人员沙盒帐户(演示)中的信封
- 将收件人添加到信封时,您没有设置
属性clientUserId
- 您发送信封的帐户中未启用允许嵌入式签名的设置
在最后一个示例中,默认情况下,所有开发人员沙盒帐户都启用了嵌入功能,但如果您在演示中进行测试,并且它在您的帐户中以某种方式被关闭,则您必须联系您的帐户经理或DS支持人员才能启用。如果您想与帐户经理交谈,请在创建帐户后跟进您收到的培育电子邮件。加载已知用户的收件人视图时,您只需要电子邮件/姓名(除了通过用户名/密码访问其帐户外)。当加载捕获签名者的收件人视图时,必须在getRecipientView调用中包含clientUserId。您如何构造getRecipientView请求?无论我是否将clientUserId提供给捕获签名者,我都会收到相同的错误消息“ACCOUNT NOT AUTHORIZED for ENVELOPE”。我使用的是从GitHub下载的DocuSign.Integration.Client.dll版本1.4。GetRecipientView请求是在DocuSign.Integration.Client项目中的Envelope.cs中构造的。您是否正在测试演示(即通过开发人员沙盒)?当您通过控制台登录时,您可以访问信封吗?是的,我正在通过开发人员沙盒测试我的演示。当我登录时,我可以通过控制台访问信封。信封是用我的开发人员沙盒登录名创建的,我的开发人员登录名也是发送者。即使我在将收件人添加到信封时将clientUSerID提供给singer,我也可以仍收到“此帐户无权访问请求的信封”调用GetRecipientView时。我的帐户经理确认我的开发人员沙盒帐户已启用嵌入。作为测试,您可以尝试通过REST API进行相同的调用,以查看是否有效?您可以通过该工具快速测试,请参阅“视图”选项卡和最后一次调用(收件人视图)。使用您通过SOAP发送的相同凭据,该调用是否成功工作?{“statusCode”:404,“headers”:{“cache control”:“private”,“content type”:“text/html;charset=utf-8”,“date”:“Tue,07 Jul 2015 18:49:09 GMT”,“content length”:“2012”,“Varie”:“Accept Encoding”,“严格的传输安全性”:“max age=31536000;includeSubDomains”}最终解决了这个问题。应该使用envelope.GetEmbeddedSignerView而不是envelope.GetRecipientView.envelope.GetRecipientView,只有当登录电子邮件/用户名与签名者的名称相同时,它才起作用。不确定这是一个错误还是出于设计。