Docusign Powerforms Embed Success Status - docusignapi

I'm working on a PHP application that has multiple products which require signing from a customer before going for the product.
I'm using powerforms link to embed them on my application (using iFrame).
They work fine. But the problem is I need to store the document signed status in my database.
The we can set a return URL in the Docusign Preferences Page. But that will be static and I won't have a clue of what product the user has selected.
References:
Powerform Docs

You can use DocuSign Connect to receive real-time notifications of envelope events (for example, Envelope Completed). At a high-level, it works like this:
You login to DocuSign web console (as Admin) and create a Custom Connect Configuration. As part of creating this configuration, you'll specify the endpoint (http address) that you want Connect to send notifications to, and which events you want to be notified of.
You build a "listener" -- i.e., the web page that will receive the HTTP POST messages from DocuSign Connect, and process those messages.
When an Envelope or Recipient event occurs (for which you've enabled notifications in your DocuSign Connect Configuration), Connect will almost immediately send an HTTP POST to your listener. This message contains XML with info about the Envelope, Recipients, Documents, Fields, etc. You'll develop your listener such that it parses the XML message to determine Envelope status, data field values, etc. and then can respond appropriately within the context of your application (i.e., in your scenario, your listener would use the XML message from Connect to determine envelope status and which product(s) the user selected).
See this guide (http://www.docusign.com/sites/default/files/DocuSign_Connect_Service_Guide.pdf) and this page in the DocuSign Dev Center (http://www.docusign.com/developer-center/explore/connect) for more detailed information on configuring/using DocuSign Connect.
UPDATE - Using Custom Fields to populate unique Identifier for Envelope
Depending on the nature of your use case, you might need to use an "envelope custom field" to populate a unique identifier for each Envelope in the "create/send envelope" request, so that your listener application has a way of identifying the envelope when it receives a Connect message. (An 'envelope custom field' is simply a custom piece of metadata on an envelope.) Simply set the customFields property in your Create Envelope request, and populate a single textCustomFields item with the unique identifier. For example:
{
"emailSubject": "Please sign this",
"emailBlurb": "Please sign...thanks!",
"customFields": {
"textCustomFields": [
{
"value": "1234567",
"required": "false",
"show": "true",
"name": "ProductId"
}
]
},
"status": "sent"
...
}
See the REST API Guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) for more detailed info about using Custom Envelope Fields.

Related

DocuSign ID Check with Embedded signing for documents sent via JAVA SDK

I'm trying to achieve ID Check on embedded signing through an envelope sent via Docusign Java SDK. I am able to make it work through remote signing however, I get the following error on embedded signing.
{
"errorCode": "INVALID_REQUEST_PARAMETER",
"message": "The request contained at least one invalid parameter. The value of AuthenticationMethod is invalid."
}
I'm fully aware of another post on the same topic posted in 2013 (DocuSign ID Check with Embedded signing). The difference here is that I'm not using any document templates but sending the documents in the envelope itself. Based on the comments a bug was logged with bug id 30830 but I can't say whether this was resolved.
Also, I have already added the settings that I know that are required for ID Check.
signer.setRequireIdLookup("true");
recipientViewRequest.setAuthenticationMethod("ID Check $");
Can anyone advise on what I'm missing ?
It's a little hard to tell from your question but from what I gather you might be setting the properties on the wrong request. As you know when creating a remote signing request you can do it through just one API request - Envelopes: create.
For embedded signing you still first create an envelope (with an embedded recipient) but then you need to generate the signing URL by calling EnvelopeViews: createRecipient.
When setting the ID Check authentication for your recipient you still need to assign this in the first request (ie the create envelope call) so that recipient is configured like so:
"recipients": {
"signers": [
{
"idCheckConfigurationName": "ID Check $",
"requireIdLookup": "true",
...
}
]
}
THEN, in the request body of the second call you need to set the authenticationMethod with the same value and provide the other required params to identify the signer.
Please confirm you are following this flow and if so and still stumped then post the actual JSON that you are sending for your requests and we should be able to determine from there.

TemplateRoles Adding, not replacing signer

Left Column 'Get' recipients, Right Col 'Post' envelopes
The problem is Instead of Replacing the Client as I expected based on docs.
It Added a second signer to the process. My template was set up for two roles Advisor and Client. I excpected the client to ONLY be the one I passed via the api. Instead it sent 3 emails total. One to Template Client, One to Template Advisor and one to Api Passed Client.
Unless I misunderstand the api function, It should not have sent an email to
original template Client.
When this happens, it usually means that the values you specified for the recipient in your "Create Envelope" API call did not exactly match the values that the template specified for the recipient role (i.e., roleName, etc.).
To resolve this issue, I'd suggest that you issue a "Get Recipients" call for your template (GET /v2/accounts/{accountId}/templates/{templateId}/recipients) to identify the exact values that the template defines for the "Client" recipient role, and then ensure that your "Create Envelope" API request specifies the same exact values (including case) for the recipient that you want to occupy the "Client" role. If you try this and still can't figure it out, then please update your question with your "Create Envelope" request and the results of the "Get Recipients" request, and someone here on SO will likely be able to spot your issue.
The template b521bece-6440-430a-9762-bf8d4543edc5 already has the recipient email/name filled.
Since recipients details are already filled, in the template, you will not be able to substitute the values during envelope creation.
You can modify the template and leave the name and email fields empty.
Then Create the envelope with just a single recipient. The notifications will only be sent to the single recipient.
POST /v2/accounts/{accountId}/envelopes
{
"status": "sent",
"templateId": "b521bece-6440-430a-9762-bf8d4543edc5",
"templateRoles": [
{
"email": "mike#acme.com",
"name": "Mike TestName",
"roleName": "Client"
}
]
}

C# Docusign API - Getting Remote Signing View URL

After running the console app, our users get an email with the signing link to Docusign making them remote signers.
What I want to be able to do is get those links from their emails.
I did some research and this is what each url is made of
https://demo.docusign.net/Member/EmailStart.aspx?
a=65d11cf7-d3b7-49a1-8000-6192b6227d71& <<< Unique Activity ID? Always different in all URLs
acct=a0e816ac-3919-475e-a826-34c2c33f90e7& <<< Some kind of role ID (stays same between envelopes and users of the same role, I have it
for my roles..just don't know how to get it programmatically
er=62378ec0-39ce-495e-84e4-e0e598fab3cc& <<<< envelopesApi.ListRecipients(.....) .Signers[n].RecipientIdGuid, able to get it
espei=30cec285-39cd-45a3-bb8e-7bd0560dcd80 <<<< ENVELOPE ID, able to get it
The first parameter is the main focus of my question - it is a total mistery what is it and how to get it
The second parameter looks like a role_id, but I don't know how to get it other than hard-coding values for each of my roles
The other two parameters aren't a concern.
Does anybody know how to get ahold of the first two parameters using the C# Docusign API?
Or even better, is there a way to get the recipients signing url links using the same API?
To obtain the signing URL you will have to set the recipient as an embedded recipient.
After the envelope is created, use the createRecipient:EnvelopeViews api to retrieve the Signing URL.
You have to set the recipient clientUserId parameter to mark a recipient as an embedded recipient.
Request
{
"userName": "name",
"email": "examble#email.com",
"clientUserId": "clientUserId",
"authenticationMethod": "email",
"returnUrl": "your app url"
}

Embedded Docusign Signing URL - using document visibility to only show 1 document in the envelope

I am creating an envelope via the Docusign Rest API. this envelope has 2 inline templates each have their own roles and do not share any tabs. I have a custom workflow that requires the user to fill in each document separately so i use the (/views/reciepients) endpoint to get a signing url.
The first signer sees the first (and only the first) document correctly, it is filled in and completed. Then i want to show the second document from the envelope in an iframe to a user. When i get the signing URL for the second recipient (signer) it also includes the first document all filled out.
I have document visibility set up on the account.
I have read the documentation a few times and there is one confusing, under "Post Recipient View" there is a field "userName" which is not mentioned when creating the recipient or in the response from the recipient end point. I assume this is the "name" field.
to make it a bit easier to read i have put all the API requests into paste bin.
Generate Envelope with 2 templates and 2 signers.
Request = http://pastebin.com/e98Dwaj8
Get First signing URL using /envelope/xxxx/views/recipient
Request =
{
"returnUrl": "http:\/\/local.example.com\/return.html",
"authenticationMethod": "none",
"email": "role1#example.com",
"userName": "TestFirstName TestSurname",
"clientUserId": "1"
}
Get recipients for envelope after first signer has completed
Response = http://pastebin.com/9VmGsE3p
Get second signing url (this shows both documents when visited)
Request =
{
"returnUrl": "http:\/\/local.example.com\/return.html",
"authenticationMethod": "none",
"email": "test#example.com",
"userName": "TestFirstName TestSurname1",
"clientUserId": "2"
}
Is there a way i can show the second signer only the second document?
Is it possible or will the completed document always show? does the /views/recipient url only hide documents in "draft" or "sent" and always shows "completed"?
note: this is a follow up to Docusign signing url - Showing document 1 of a composite template but that question was answered and solved the original issue so i thought it best to open a new more specific question.
In order for certain signers to only see certain documents, you will want to investigate the Document Visibility feature and settings. There is some starting documentation available at: https://support.docusign.com/guides/cdse-user-guide-advanced-sending-using-document-visibility-in-a-template
In short, signers can only see documents in an envelope for which they have at least 1 tab assigned. This is honored during the signing ceremony as well as any view of the completed document.
Regarding your last question, you should only be able to start a POST /recipient/view (signing ceremony) for an envelope which has been SENT. If you perform this action against an envelope which is completed it will start the signing session in a read only viewing mode (since the transaction is complete).
Is the 2nd signer a member on the sending account? If so, they would be able to see all documents in the envelope based on "Must sign to view unless Sender Account". This setting essentially means internal signers that have memberships on the same account as the Sender can see everything.

Global tabs for document templates

Is there a way to assign tabs to a document, without having a recipient declared?
Situation: We want to have a template for an employee application, and then use the API to fill the fields, assign the recipients, and embed for signing.
When I create the template with no recipient, it doesn't allow me to place any tags. Given that I don't know the recipient until the time I call the API, does that mean I can't place the tabs until then? I really don't want to have to place 50 tabs dynamically.
Thanks in advance.
Chase
DocuSign tabs are always with respect to a given recipient, never the document itself, however I believe you can still accomplish this workflow. If you create a Template through the DocuSign Console you can add a template role without providing any recipient info (i.e. name or email) at that time. Afterwards when you reference this template through a signature request API call you can then supply the actual recipient names and emails in the request and map them to your already configured envelope tabs through the
roleName
property for each recipient.
The very first DocuSign API Walkthrough has code that demonstrates how to do this with just one role, but note that this is just an example and you can have multiple roles.
DocuSign API Walkthroughs
From a high level these are the steps you want to take:
Create a template in the DocuSign Console.
Add document(s), then add at least one recipient but only fill in the role field.
Now on your document you'll see that you can add whatever tabs you want to the envelope, under that role.
Save the template.
Make an API call for requesting a signature, which references the templateId and has the roleName parameter present for your recipient(s). This roleName value should match the role that you saved with the template in step 2.
If you named the role Signer1 for instance, your request body (in JSON format) might look like this:
{
"accountId": "123456",
"emailSubject": "DocuSign API Call - Signature Request from Template",
"emailBlurb": "Sample email body",
"templateId": "B977F511-CAB0-...................",
"templateRoles": [
{
"roleName": "Signer1",
"email": "test#docusign.com",
"name": "John Doe"
}
],
"status": "sent"
}

Resources