Why do I have to navigate to a generated "editor" URL twice before it redirects properly?

时间:2018-06-04 16:44:17

标签: c# docusignapi

I'm currently sending an envelope on behalf of a user (let's call them User 1) and adding an editor role as the first recipient of that envelope (let's call them User 2). After the envelope is sent, I attempt to create an editor view for User 2.

When I create an editor view for User 2, the first time I use the URL it automatically redirects to the provided returnUrl instead of the editor view for that envelope.

Why does this happen?

If I use the exact same URL a second time, it redirects to the editor view as expected.


Example Below:

The code I am writing uses the C# API, however, for sake of simplicity, I included a simple request that replicates the exact same problem.

Request:

POST: https://demo.docusign.net/restApi/v2/accounts/AccountId/envelopes/50545884-35da-4735-b076-f07883450146/views/edit
HEADER: X-DocuSign-Authentication {"Username":"API Account", "Password":"API Password", "SendOnBehalfOf": "User 2 Email", "IntegratorKey":"Integration Key"}
Content-Type: application/json
Body: {  "returnUrl": "https://www.google.com/" }

Response:

{
    "url": "https://demo.docusign.net/Member/StartInSession.aspx?StartConsole=1&t=5dd34549-b5a1-4ccf-b039-243ce06e264d&DocuEnvelope=50545884-35da-4735-b076-f07883450146&send=1"
}

The first time I navigate to the URL I get redirected to Google. I copy the exact same url again and the second time I redirect to the expected editor view for that envelope.


Updated Details on Envelope Creation:

The header used during the creation of the envelope is similar to below:

HEADER: X-DocuSign-Authentication {"Username":"API Account", "Password":"API Password", "SendOnBehalfOf": "User 1 Email", "IntegratorKey":"Integration Key"}
  • Sender: User 1 Email
  • Recipients (as described by the envelope and request):
    • Order 1 - Editor: User 2 Email
    • Order 2 - Needs to Sign: Real recipient
    • Order 100 - Receives Copy: CC User 1
    • Order 100 - Receives Copy: CC User 2

Easy Way to Replicate Issue:

Login into DocuSign.

  1. Create a new envelope.
  2. Add a recipient (Email: testeditor@mailinator.com) as a Editor in Order 1.
  3. Add another recipient (Email: testsigner@mailinator.com) as a Signer in Order 2.
  4. Upload a random document.
  5. Add a single signing block to the document for Signer.
  6. Send the envelope.

Using POSTMAN:

  1. Use the following information for the request:

POST: https://demo.docusign.net/restApi/v2/accounts/AccountId/envelopes/{envelopeIdFromStep6}/views/edit

HEADER: X-DocuSign-Authentication {"Username":"API Account", "Password":"API Password", "SendOnBehalfOf": "testeditor@mailinator.com", "IntegratorKey":"Integration Key"}

Content-Type: application/json

Body: { "returnUrl": "https://www.google.com/" }

  1. The url is returned: https://demo.docusign.net/Member/StartInSession.aspx?StartConsole=1&t=cda7bdd2-0ce7-4478-a659-7984bf982687&DocuEnvelope={envelopeIdFromStep6}&send=1

1 个答案:

答案 0 :(得分:0)

在与DocuSign支持人员交谈后,确定必须两次导航到编辑器的URL是一个错误。我们试图在服务器端“丢弃” URL的首次使用,但是,发现使用了cookie。这使得无法在客户端上第二次使用URL。

唯一值得注意的解决方法是通过客户端上的隐藏iFrame导航到URL,这将无法重定向,但会在浏览器中建立cookie,然后再次使用URL再次重定向浏览器。从最终用户的角度来看,该功能将正常运行。

此问题的修复程序目前在工程团队的手中,尚不知道发布或修复的日期。

相关问题