docusign REST API How to return signer to a url after signing PHP - docusignapi

I am building some functions to create my JSON using the sign-client PHP API and Models. I am create an envelope on docusign using the API and sending signers emails where they go to docusign to sign. I am not using embedded signing. I am doing this all though the API and plan to get and API plan so will not have all the web-based access.
I have one or more signers and after they sign I need to direct them to a URL on my site where they can make a payment. This URL us specific to each envelope, not the same for all signers.
I believe what I need to add is a 'returnUrl' to the createEnvelope so after the users sign, they are redirected back to my site. Here is what I have, but it is not working.
$signer = new \DocuSign\eSign\Model\Signer();
$signer->setName($signer_details['name']);
$signer->setEmail($signer_details['email']);
$signer->setRoleName($signer_details['role']);
$signer->setRecipientId(1);
$signer->setRoutingOrder(1);
$signer->setEmailRecipientPostSigningUrl('https://www.example.com');
By default, after signing the signer is given a docusign page. I am pretty sure there is a variable I can use to redirect them to my site. Anyone know how to do this?
Thom
Thanks!

If you want to redirect signer back to your App after signing is completed then you can configure Destination URL in your Branding. You can find details here, check Destination URLs for post-signing navigation section. Destination URL in Branding will be used only for Remote Signing.

The returnUrl property only applies for embedded signing.
Otherwise you would not be able to set it via the API - you would need to set it in the Branding options under "Go to Admin" and then "Brands" and then default brand, "Edit" and then "Destination URLs" and you can set the return URL for signing there based on the action that the signer takes.
Embedded signing allows you to set the returnUrl parameter and use a distinct URL for every session to return back to a specific place in your application instead of a generic one.
See https://docs.docusign.com/esign/guide/usage/embedded_signing.html

Unfortunately, the emailRecipientPostSigningUrl parameter is currently undocumented. I've asked the DocuSign engineering group for more information on it.
Meanwhile, please provide more information on what you want to do. Are you using embedded signing or signing via email notification from DocuSign?
Please edit your question to provide the additional information.
Added
As indicated in other answers, if you want to have a per-envelope URL then you either:
Use embedded signing. This is probably your best bet.
Or use the one url for all envelopes (via branding), then that url determines the real url for the envelope and further redirects the signer. I don't know if your first url receives the envelope_id or other information about what the signer did.

Related

DocuSign - Get Signature URL using eSignature REST API v2.1

For the envelope which has been already created and notification has been sent to the recipients, how do we get the signature URL using eSignature REST API? The signature URL is nothing but the link which is embedded in the DocuSign email to the recipients.
Update: Once the envelopes are created, I am trying to show the signing links in a web portal so that users can view all the signing links and take action.
If you would like to use this URL inside your app, we call this Embedded Signing. You can follow a code example in multiple languages to do that here.
You make an API call to this URL:
POST /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient
And you provide something called clientUserId which is a unique string that represents your app/user/envelope.
You can also provide a redirect URI where the user would land after they're done signing.

DocuSign - How to get a URL that lasts longer than a few minutes?

I am using the DocuSign REST Api and noticed that the lifetime of a URL obtained using the EnvelopeViews API (https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient) is only a few minutes. However, I have gotten emails in the past with DocuSign links. How are these links able to be added to an email (and therefore have a longer lifetime)?
Is there a separate API that can be used to get a longer-life link like the one in the email?
For example, here is an email that has a Review Document DocuSign link:
Good question. Here's what you can do.
Your application wants to let Larry sign a document using the
EnvelopeViews::createRecipient API call.
Your application should store the details needed for the API call in your app's database. Something like: envelopeId, signerEmail, clientUserId.
Create a guid for the database record and add it to the database record.
Now you can look up the database record via either the row's key or
via the guid. Ensure that the guid database column is indexed.
Now create a signing url that you will send to Larry. Something like:
https://myapplication.example.com/docusign-ceremony/[guid]
Send the url to Larry
When Larry clicks on the URL:
Your app is invoked
Look up the guid in the url in your database. You should find the
record that you stored there.
Retrieve all of the record's info: envelopeId, signerEmail,
clientUserId.
Call the EnvelopeViews::createRecipient API call with the data
and get back the signing ceremony url (that must be used within
5 minutes)
Redirect the user's browser to the url.
They'll sign the document(s) and then be re-directed back to your
application.
Done.
And guess what? This is pretty much what DocuSign does itself.
The response from Larry K above is correct, you would need to handle this on your side.
These are all the parameters that you can send as part of the request body for the POST {vx}/accounts/{accountid}/envelopes/{envelopeid}/views/recipient API endpoint and there are no options to set the expiration time for the recipient view that you create.
You could look into using PowerForms to see if they fit your needs. With PowerForms you can create a URL that users can click and it will allow them to fill out a specific DocuSign envelope. This might not fit your needs if you need to pre-fill some of the fields with information related to the specific recipient but it might be worth looking at.
PowerForms Documentation:
https://www.docusign.com/features-and-benefits/features/powerforms
Please correct me if I'm wrong but I think that your goal is creating the recipient view URL, creating an email formatted in a specific way and sending that email to the recipients.
If you use the branding feature you could specify the format for your email (if you want to use a specific message) and just send the envelope to your recipients. Once the recipients receive the email they'll see the message in the format that you specified and the link for accessing the envelope would be a regular DocuSign link that doesn't expire.
The link below shows how to create Brands in your account. Specifically signing brands would allow you to set the email content.
If you have multiple email formats you could create multiple brands and just specify the brandId when creating the envelope.
I hope this helps.
Branding:
https://support.docusign.com/guides/ndse-admin-guide-configure-branding

DocuSign: Rest API C# get permanent links for signers

I'm using DocuSign's REST API to create envelopes in embedded signing mode. With the function CreateRecipientView i get only a temporary link. But i would prefer to get an permanent link like in the notification mail. How can i get this link/URL?
Getting permanent signing links is not possible using the DocuSign rest API.
For remote signers, only the signer can receive the signing link through email. No one else will have access to the signing URL.
Setting permanent signing/access link is possible with "embeddedRecipientStartURL" by using a captive recipient aka "clientUserId" and your own URL endpoint whereby you authenticate your users and determine if they can access the envelope via a Request Recipient View.
Documentation here.
You can also request emails be sent per captive recipients as well as many other "Portal" centric options that put you in full control of the user experience.
To give your signers permanent links, your application creates the links by itself. Eg myapp.myserver.com/signing_links/95a086f7-a76e-40ec-938e-987be996d220
The number should be a guid, not a database record key. This is needed to prevent someone from guessing what one of these permanent links is, so they can't read (or sign!) someone else's documents.
When someone opens their browser to go to one of the signer links, your application looks up the guid in the your app's database. The database record will include the DocuSign envelope_id and the recipient_id that the link represents.
Next your app uses that data to request an embedded recipient view link from DocuSign. Then (if you get a good response back from DocuSign), your app redirects the user's browser to the signing page on DocuSign.
(You'd get back an error from DocuSign if the recipient had already signed, or the envelope had been voided, etc.)
Guess what? The above is more or less how DocuSign gives out the "permanent" links in its emails--those links always redirect to one of the 5-minutes-only signing ceremony links.
Remember that you need to authenticate the signers, or include additional authentication options in your envelope, since you don't know who is going to end up pressing one of your app's signer links.
Setting vs Getting permanent signing/access link is possible with "embeddedRecipientStartURL" by using a captive recipient aka "clientUserId" and your own URL endpoint whereby you authenticate your users and determine if they can access the envelope via a Request Recipient View.
https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Recipients/Signers%20Recipient.htm
You can also request emails be sent per captive recipients as well as many other "Portal" centric options that put you in full control of the user experience.
So Net/Net, LarryK and CodingDawg are correct, each from a specific view. It ultimately is up to you to decide which way works best for your application and users.

Getting an embed url for an already created docusign envelope

In docusign is it possible to create a signing request via the web interface and then retrieve the sigining URL via the API
at the moment, I update the Envelope using the API to attach a clientUserID as this is lacking when created via the web interface.
Then I retrieve the signing view url however, there is no signing tab when navigating to that url. The only action I have is to close.
I have tested using the API and the envelope contains signing tabs so I'm not sure what the issue would be.
Any help would be much appreciated!
When you send a DocuSign envelope if you assign one or more tabs to your recipient it becomes what's known as a Free Form signing experience, where the recipient decides where to sign the document.
On the other hand if you specify one or more tabs for the recipient then it's a Guided Signing experience. In guided signing the recipient can only sign and take actions at the tabs the sender has specified.
It sounds like you are successfully creating the envelope and signing URL but that there are no tabs configured for the signer. If that's the case you should confirm your code is identifying the recipient correctly by specifying the name, email, recipientId, and clientUserId values.
I would also check that the tabs are being set in your request body correctly for the given recipient. First get the recipient information for the envelope using the EnvelopeRecipients: list API to ensure the data is what you expect, then generate the signing URL using the corresponding data.

Where can I find the security code in the Envelope

When DocuSign sends an email to a user requesting a signature, the View Documents button contains a link to a URL such as this:
https://demo.docusign.net/Member/EmailStart.aspx?a=564ffc65-28s7-402b-a499-cfec5526db3c&er=ac335504-8a6d-49a0-bfb6-3793887c0722
I know that the second parameter in the URL call is the recipient Id, which I can see in the envelope. However, I cannot find the first parameter.
Is there anyway I can regenerate the URL?
The reason I ask is that we have a website with a message center. Upon logging into our website, if the user has documents that require signature, I want to display a list of links for them to click and sign.
If you have a website with a message center and login I believe you should shift your paradigm of how you use DocuSign. DocuSign has a concept of an embedded signer. That means you notify the signer and when they log into your site you can make a web service call to present the person with a signing in an IFRAME or a separate window.
You can find the breakdown of that scenario in this code walkthrough:
http://iodocs.docusign.com/APIWalkthrough/embeddedSigning
A broader overview is here:
http://www.docusign.com/developer-center/explore/features/embedding-docusign
It is impossible for you to figure out or regenerate the GUIDs that are passed with envelope notification. That's one of the security features of DocuSign notifications.
Hope this helps.

Resources