-->

Send (Load) a URL to web browser and run it in bac

2019-09-04 05:20发布

问题:

Does Apex/Visualforce allow a URL which is stored as string in apex and run it in web browser in background.

Actually, that url is returned from a Docusign RestAPI callout for posting the envelope into "correction" status. The Envelope correction Status is not activated until i manually paste the url (link) in to a web browser and run it.

Does anyone know how to run a url programatically in a web browser through Apex/Visualforce in background ?
(or) Is there anyway that i could activate the "correction" status of envelope in Docusign other than running the URL in web browser?

回答1:

As I understand your question(s), the simple answer is NO/YES, but let me break it down:

  1. Run String URL from Apex - Yes - See pagereference

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_system_pagereference.htm

  1. Can you run a URL in Background - Yes you can use HTTP class

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_http.htm#apex_classes_restful_http_http

  1. Can you run a DocuSign correct URL in Background - NO, the URL you get back requires the Browser for rendering and user UI interaction.

  2. Other Way - YES via the DocuSign REST API you can correct the envelope if it has not been completed or the signer has not completed their signing action. Also I have lab I created to demonstrate this on Amazon if you are interested in a step by step example of DocuSign correct.

    https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_http.htm#apex_classes_restful_http_http

SAMPLE HTTP PUT via DS REST API below for existing an envelope:

PUT /restapi/v2/accounts/437977/envelopes/ed3be3c1-be06-41c2-c68c-10ddccbd655e/recipients 
Host: demo.docusign.net
X-DocuSign-Authentication: {"Username":"yourdsemailorID","Password":"yourpasswordorDSapipassword","IntegratorKey":"yourDSintegratorkey"}
Content-Type: application/json
Accept: application/json


{ "signers": [ { "recipientId": "1", "name": "David W. Grigsby (corrected)", "email": "youremail@yourdomain.com" } ] }