1
votes

We have integrated docusign into our application and are able to create an Envelope, add signers and create a recipient view url via the docusign API.

The next step is to allow the sender to view the envelope and to do so we are using the create sender view API. We are able to make the request successfully and a url is returned.

Our API that calls the create sender view API:

# the url to return to e.g. https://mywebsite.com
return_url = ReturnUrlRequest(return_url=data["return_url"])

# call the docusign API            
results = envelope_api.create_sender_view(
   session["ds_account_id"], 
   envelope_id, 
   return_url_request=return_url
)


# returns a json object with the url to the client 
return jsonify({"url": results.url}

Example url returned from the docusign api call: https://demo.docusign.net/Member/StartInSession.aspx?StartConsole=1&t=xxxx&DocuEnvelope=xxxx&send=1

The URL is passed to the front-end web application (ReactJs) and it is used to redirect the user to the sender view page. e.g. window.location = response.data.url.

This is where the issue occurs:

  1. Instead of redirecting the user to the docusign website, the user is immediately redirected back to the application.

  2. When I copy the url and manually paste it in a new browser tab it immediately redirects me back to the application, but the second time I visit the url in a new tab it works.

Am I missing something?

Create sender view docs: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/createsender/

EDIT: When we set the return_url as an empty string when creating the sender view url, the user isn't immediately redirected.

1

1 Answers

0
votes

Can you verify the status of the envelopes you are trying to access?

Create Sender view should be used to allow the sender to edit draft envelopes before sending it. In your scenario you mention that the recipient has already viewed it so this may be the problem.

If you want to allow the sender access to edit the envelope after it was sent you will need to use the create correct view API call:

https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/createcorrect/

EDIT: If you want the sender to view the completed envelope you should use the create recipient API with the senders information

https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopeviews/createrecipient/

Your request body should have the following structure:

{
    "authenticationMethod": "Email",
    "email": "sender@email.test",
    "returnUrl": "https://www.google.com/",
    "userName": "Sender",
 
}