Docusign : How to know the originator of recipient event - docusignapi

We have single connect configured for all document/recipient events.
And if we have a document that is sent to 4-5 recipients with no signing order in place.Each time a recipient signs, the 'Recipient Signed' event is triggered.
But, there is no info as to how to identify which recipient has exactly triggered the event??
Currently, DocuSign connect sends the xml response with all the Recipients' status.

Correct, if you want to know what has changed to cause a connect message to be sent to you, then you need to compare the latest message with the prior one.
Note that there can be more than one reason for a single connect message to be sent. Eg, when the last signer recipient signs, his status will be changed as well as the overall envelope status.

Related

Recipient Delivery Failed -- Webhooks and Correcting/Resending via the API

I've been working on an integration that sends an envelope to 2 signers. I am trying to test and program for the case of 1 of the signers having a bad email address. I would need to:
Be notified of this (webhook?)
Update the email address for the signer
Update the email address in the custom fields as that's printed on the agreement
Resend the envelope
When I enable the delivery failure notification in Connect (this is set up at the account level, for now), I don't see where the failure is noted in the webhook response or for which signer the error is happening.
I've found multiple links via Google talking about "correct and resend" but I haven't been able to get anything definitive in terms of what steps need to be taken or a (PHP) code example. I've also found "resend" in the API reference but still no code examples.
I also haven't seen any code examples (PHP) of how I would update a signer's email address and how that would work via the API.
It'd also be good to know how to update custom field data for both signers so the email address in the contract is updated (it's listed separately as part of the custom form data).
And finally, how would I resend the envelope?
Thank you for your thoughts.
Per DocuSign support (customersupport#docusign.com):
Be notified of this (webhook?)
I have updated your account settings and now you should be able to see AutoResponded in your webhook messages when email invalid or unreachable.
(my comments: so it sounds like you have to ask to be able to see this stuff, it's not part of their standard webhook responses)
Update the email address for the signer
I also haven't seen any code examples of how I would update a signer and how that would work.
Unfortunately we don't have an example for recipient update but the logic is to get list of all recipients, pick the one need to be updated, and update.
You can use below to retrieve all recipients per envelope
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/enveloperecipients/list/
GET /restapi/v2.1/accounts/accountId/envelopes/envelopeId/recipients
Extract the one you need to update edit email and update using the below
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/enveloperecipients/update/
PUT /restapi/v2.1/accounts/accountId/envelopes/envelopeId/recipients
You can also see example code in C# how to do this in this thread https://github.com/docusign/docusign-csharp-client/issues/307
Update the email address in the custom fields as that's printed on the agreement
There is bug case created ( above link ) regarding this. At the moment you can not update signer custom fields case EC-2944.
Resend the envelope
You can resend the envelope during recipient update
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/enveloperecipients/update/
PUT /restapi/v2.1/accounts/accountId/envelopes/envelopeId/recipients
My commentary:
Since custom fields can't be updated, this whole use-case goes out the window. We can't have contracts with incorrect data on it, so my client will have to do these corrections by hand. Kind of a bummer.

Enforce user & document specific tabs/fields within DocuSign embedded Sender screen

I have an ASP.NET MVC application that's using the DocuSign REST API to create a draft envelope, then redirect to the DocuSign Sender view, for the user to then manually add the relevant tabs/fields for each recipient, to each document.
Is there any way when creating the envelope, to state that for a given recipient, at least one signature field needs to be added (within the sender view) to a given document; for another recipient, they must add both a signature and initials field/tab to a given document, and so on. The result being that unless those criteria are met within the sender view, i.e. the sender has not added those necessary tabs/fields, then the sender cannot send the envelope until they've been added?
Basically, we don't know where on any documents these tabs/fields need to be applied, so we leave it up to the sender to add them in the DocuSign sender view, but it would be nice if we can ensure the sender does actually add the necessary tabs/fields accordingly - preventing the envelope from being sent with documents that have missing fields.
Is this possible?
You can do this but it is tricky. Here's another way to look at solving the use case; what I think you're asking for:
Your application creates the envelope in draft format
Your application opens a sender view for the human to do their tagging of the document(s) for the recipient(s)
You want your application to now have the ability to check that the human did add a certain number of tabs for various recipients. If they did, then the envelope should continue on its way to the first recipient. Else, you want to have the human try again with the sender view, or abort the send, or make the alarms go off, etc.
Here's how you can do the above:
When your app creates the envelope in draft form, add an additional signer recipient, as an embedded signer. Something like
{email: "noone#example.com", name: "App check tabs step", clientUserId: "1", routingOrder: "1"}
All the real recipients will also need their routingOrder to be set, and to a number above 1.
After the human completes the sender view (where they hopefully added the tags correctly), the envelope will be set to sent status and it will start to be routed. But since the first recipient is the embedded signer, the envelope will wait for your application to handle that recipient (because it is an embedded recipient).
After the human completes the sender view, your application can then "check" the envelope to see if the tabs were added per your specification--your app will just need to get the envelope recipients/tabs and check to see if the tabs were created.
Next step if the tabs were added correctly: your application should obtain an EnvelopeLock, then delete the embedded recipient, then delete the EnvelopeLock. Once you do this, the envelope routing will resume with the next recipient, the first "real" recipient.
If the the tabs were NOT added correctly, then you can probably open an Editing View screen for the human to fix the tabs. Or you could void the envelope. (Then re-check the envelope's tabs and then remove the embedded signer when you're ready for the envelope to proceed.)
The above works fine. There is a downside that the certificate of completion will show that the envelope was "corrected" when the "application user" was deleted.

Returned document lacks signature

I'm performing a DocuSign integration with a FileMaker solution to send signature requests via email, and receive a copy of the signed document once completed. I'm using the Java SDK to email signature request, as well as a Javalin app process to listen for the completed signature event, as well as more Java to pull the document back into FileMaker.
When the completed document is sent to my listener and pulled in, the document lacks a signature and tab field. It essentially looks just like the pdf document before being sent.
I have a feeling there's a variable I can tweak in some object to allow the signature to appear after being signed. I've played with all the usual suspects (e.g., eventNotification.setIncludeDocumentFields("true")), but nothing seems to do the trick. Any hints?
Aside from looking through the code for every object I'm instantiating and trying different variations, it's hard to pinpoint the exact source of failure in this. Thanks for any leads!
Sounds like you're receiving notifications by either including the eventNotification object in your Envelopes::create call or are using Connect at the account level. Either way, that's great, that's exactly right.
You can request notifications at many different points along the processing route of the envelope. To receive signed documents, you'll want the notification when the envelope is completed. At that point all signer recipients have signed.
To receive the notification when the envelope is complete, either adjust your Envelope Send parameters (the eventNotification value) or the settings for Connect (via the Admin tool), whichever one you're using.

Docusign event notifications

I am implementing a listener for Docusign event notifications. For each new event Docusign sends a new xml serialized DosuSignEnvelopeInformation object. My question is, does that object include only new changed statuses or if for example one of the recipients status has not changed it will still be included. Also, since a change to one of the recipients status does not necessarily change the envelope status, will the notification always include the envelope status ?
I'd recommend taking a look at the XSD: https://www.docusign.net/api/3.0/schema/dsx.xsd
The type sent by connect is DocuSignEnvelopeInformation, which consists of EnvelopeStatus and DocumentPDF objects, both of which have their schema defined in this XSD. In short the connect XML is a snapshot of the envelope at the time the notification is sent to you - the snapshot will include all recipient information.
In the sandbox environment you can enable a test DS Connect configuration with logging enabled to see what types of messages you will be receiving.
Absolutely correct and keep in mind that to save space in the demo environment we don't include the PDF byte stream in the log as it has no logic, meaning it's just a bunch of bytes. If you want to see it you can use webhook.com (free) or some other tool like that.
The Connect Service and the related "eventNotification" node in the API are event-driven. They don't publish events, but rather, the complete current status of the envelope, which includes envelope status, recipient status for all recipients, and more. The service always publishes the current status, so two "near" events might trigger one coalesced status publication, or two close publications. However, the last publication will include the latest changes. If you get a "republished" status (such as due to failed acknowledgement or directly triggered), it again is the current status, not the "old" status at the time of the original publication.

Sending iCalendar to an user who's also the organizer of the event

I'm working on a C# application that sends emails containing a vCalendar event in its body. Say I (knockycode) would like to create a calendar event via this application. An email will be sent to my email address with the following body:
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:-//MyCompany//Product//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20130819T084518Z
DTSTART:20051126T011300Z
SUMMARY:Testing that calendars get received
UID:MyOwnID
SEQUENCE:123
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="knockycode#lotusnotes.com":MAILTO:knockycode#lotusnotes.com
ORGANIZER;CN="Knockycode":MAILTO:knockycode#lotusnotes.com
LOCATION:TBC
DTEND:20051126T031300Z
DESCRIPTION:Some Body\NAnother Line of the body
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT02H30M00S
END:VALARM
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
Take note that the organizer and the attendee is one and the same. This is so the organizer (me/knockycode) can actually have the event created on my mail client.
On Exchange/Outlook and gmail, the email is received (and I can RSVP to the event).
However, on Domino/Lotus Notes -- the email is not received (i.e. not shown in my mailbox). Though the logs in the Domino console do say the email's sent successfully.... If the organizer's email address was different to mine though -- the email does get received and shown in my mailbox.
Is there some configuration of the Domino server that would allow this email to be received?
Or something else has to be added to the email body?
I think this per your last comment is working as designed. The ICS will just get you a notice on the calendar. I would go back to the Exchange side and use a new meeting form to get all the elements for interaction. If you pass a meeting notice to a Notes user (depending on the version that the client is using) from Exchange you can send invites out of the box. Notes can send replies back successfully in some instances. The issue might come up with reschedules and meeting cancels. These don't play well between systems well. Then you might run your present code to pass a ICS at the time of meeting change time/location. I would see how things work first then write your code. The ICS file will also work under remote devices like Apple iPhone/iPad.

Resources