1

Hi I am new to Docusign integration to salesforce. I have to change the status of envelope to "Correction" and I have gone through "POST" method provided in the Docusign RestAPI guide.

Doing so, the docusign returns a correction url to activate the correction status. As of now, I am manually pasting that url in the browser to activate correction view.

My question is, how to hit that URL to browser in background through Apex in-order to activate the correction status? (or) Is there anyway to activate correction view of envelope other than hitting URL to browser?

I have tried using HTTP get requests to run that URL . The first request will redirect to another link with status code 302 ("Found"), if i use another request on that using reponse.getHeader('Location') it is redirecting to member login page, (So i have passed another request to login which responded as Status "OK"), if i hit another request on member login page response.getheader('Location') the response of this latest request is "OK"(because i have already logged in using the previous request) and response.getHeader('Location') for this latest request is null and Status of envelope is not changed to "correction".

I know using these many requests is not at all a best practice, could anyone suggest me a perfect way to activate the correction view of envelope? I am in real need of this answer. Please help. Thanks.

sam_s
  • 197
  • 3
  • 12

1 Answers1

0

The correction view is possible but you have to authenticate your web service request in order to get to it. You can't just find a URL and go to it without authentication - that would violate the security of the transaction.

You can get the correction view URL by doing a POST here

https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId}/views/correct

You would also need to provide these headers:

X-DocuSign-Authentication: <DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials>
Accept: application/json
Content-Type: application/json
mikebz
  • 3,277
  • 8
  • 37
  • 50