Retrieving Recipient Status via REST API - docusignapi

There appears to be two ways I can gather status information about individual recipients on an envelope:
GET - v2/accounts/:accountId/envelopes/:envelopeId/recipients
GET - v2/accounts/:accountId/envelopes/:envelopeId/audit_events
Unfortunately, each of these suffers from a separate limitation that is making it difficult for me to use either.
This API call returns two DateTime values of interest: deliveredDateTime and signedDateTime. I am able to call and use this API successfully. However, it appears to me that deliveredDateTime is not specified until the user actually clicks the email link AND clicks the review documents button on the signer view. Since what I was actually interested in might be better described as sentDateTime, deliveredDateTime doesn't appear to work for my needs.
This API call returns a detailed list of all events that have transpired on the envelope, including individual receipient status updates. However, the data format is such that in order to tie the result data back to recipients, I have to do string matches on the recipient name. I'd prefer to do the match based on email or, better still, recipientID, but the audit log entries for "sent invitations" and "signed" don't contain these fields. Here is an example (click here to view larger):
Is there an API call other than these two that I can use? Is there a way to get additional data in the audit event API call?
Thank you in advance,
Andrew

I don't believe there's a way to get additional data from the audit_events call since the DocuSign API documentation (which is up to date) indicates that call has no parameters (other than the envelopeId in the URL).
I think you're stuck with doing a string comparison on the userName value to identify/link your recipients, however I want to point out that once you do that you can then link to their unique recipientGuid through the first api call you've highlighted here.
For instance, the /audit_events API call seems to achieve what you want and has all the info you need, however it identifies the recipients through their userNames. If you then make a call on the same envelope and check the response from the /recipients URI, it contains the name, email, recipientId, and recipientGuid for each and every recipient in the envelope. Match the user names and you now have access to their IDs, etc.
So in the end I don't believe there's one API call to achieve this but you can solve by doing one string compare and combining the results from the API calls you've highlighted.

Related

Custom document metadata when using DocuSign REST API

Is there a way that I can provide any custom document metadata when adding documents to my DocuSign envelopes when using the REST API?
DocuSign appear to enforce the use of a positive integer for the DocumentId's we provide in the envelope. Whilst we are indeed using a positive integer, sometimes, there is some additional info that we need to supply, which we would like to come back in the DocuSign webhook events for specific documents.
I've had a look at the Document object but can't see anything obvious that I could use. An example would be simply providing a true/false along with a specific document, which I can inspect when I receive the DS webhook events.
At the moment, the only workaround I can think of is to add an Envelope Custom Field which contains any of my DocumentId's where 'true' is applicable, which feels like a bit of a shoddy solution, and I don't know if there's a character limit in those Envelope Custom Fields, which could break such a workaround.
Custom envelope text fields give you complete flexibility on providing meta-data that you can get back from the webhook. Here is some information about this:
This is how you create a custom field for an envelope:
https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeCustomFields/create/
This article shows code examples in 7 languagues on how to get the custom fields values :
https://developers.docusign.com/docs/esign-rest-api/how-to/get-envelope-custom-field-values/

download signed document as JSON from docusign

It seems that docusign only supports downloading the signed documents as PDF instead of JSON.
I need to 'read' the filled fields of the documents (the document has some fields to fill in).
I can upload the document as JSON and it gets parsed, so why can't I donwload it as JSON?
How do companies normally handle the field values?
Thanks!
You don't need the actual PDF document to get the values, you need to parse the call coming back from DocuSign since that has total envelope data. The webhooks for notification contains the data and you can parse that to retrieve the envelope data.
Do you know if its also possible with a GET call instead of the webhook? It could be the server is down etc, so I can't imagine DocuSign does have something like GET:envelope/:id/data or something.. But really cannot find anything like it
Yes. You can either use a GET call (included below) any time you want to get envelope data or you can set up the webhooks so that DocuSign will send you updates whenever it has one!
The following GET call retrieve envelope data from {{envelopeId}}. By parsing the response from the call you can retrieve all information that was filled on the envelope.
{{baseUrl}}/envelopes/{{envelopeId}}/recipients?include_tabs=true
I hope this helps.
P.S. Summarized our comments to have a complete answer.
The PDF format is, for lack of better words, a complicated jumble of compiled data that can be difficult to parse. What it appears docusign will do is take the data provided and fill the PDF document fields that are previously identified.
With docusign returning the PDF, you will need to parse the PDF input fields to receive the field values. There are several libraries that can be used to parse the various form fields and do what you would like. Check out:
https://www.npmjs.com/package/pdfreader
https://www.npmjs.com/package/pdf2json
I am sure there are more that would work for you as well if you look around if these don't work for you.

Docusign API, "Correct Document" or just change fields

Using the Docusign API, I am trying to change the fields that exist on a document. When I first create the document, I am able to change field values using "tabs." I get how to do that.
When I am trying to edit, or in Docusign's terms "correct," a document after it has been sent out, but before being signed, I am having trouble figuring out how to access those fields again to change the values.
I have tried using the API avenue described here ( PUT /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields ), but even after successful calls, the values of the fields aren't changing, and I believe it is because I should be trying to access the tabs, as I did when first changing the tab values as I created the document, instead of targeting the fields, since the two seem to be different. Any thoughts? Thank you in advance for your answers.
To update Tab values you should use the putRecipientTabs api.
Once a signer completes the Signing process, the tab values cannot be updated.
Also not all Tab values can be updated. See this answer for more information.
The putEnvelopeDocumentFields api is for a different purpose. Document fields are different from Tabs. Document fields are an array of name-value custom data strings to be added to a document. Custom document field information is returned in the status, but otherwise is not used by DocuSign.
I figured it out.
The "fields" we are seeing on documents are "tabs," and they are children of the recipients.
The hierarchy goes envelope > recipients > tabs, which tabs we were trying to change. Not envelope > document > fields, which refers to something else--just familiarizing with the language of the api.
Here is a link to the reference for how to change "fields" aka "tabs", and that link includes sample requests.
One thing that helped me target my actual fields, since I kept on getting an error that the field didn't exist for the recipient, is to do a get request of all available tabs and use that response body as the request body for the update call (where we change the field values). Then you know the field information will be accurate, paring the body down to exactly the "fields" aka "tabs" you are interested in targeting.

Advanced Find giving wrong(?) result

I am using Microsoft Dynamics CRM 2011.
I have to get all the activities which are of type Appointment, Campaign Activity, E-mail, Opportunity Close, Phone Call, Recurring Appointment or Task. There are some more filters added as per my need. I am using Advanced Find for this one. Till this, my advanced find looks like:
It is returning me results, which are valid.
Now, I want to add another clause to this and shortlist the results which I am getting till now. The clause is: Don't show me the activities (most of which are E-mails) in which sender or recipient contains 'Test'.
For this I have designed following:
As per me, this should give correct results, but this is returning me no records.
The way I read your requirement:
Don't show me the activities (most of which are E-mails) in which
sender or recipient contains 'Test'.
It can be rewritten as: Show me all activities where:
Sender contains data
Sender does not contain test
To Recipient contains data
To Recipient does not contain test
That can be done in the following way (where you go down to the Sender Activity Party, back up to Activity and then down to the To Recipient Activity Party):
This approach requires that the returned Activities have both types of Activity Party (which is probably only true for most Emails), which might not be what you intended.
To keep it simpler, you might be able to do with simply avoiding any Activity Party containing test:
Note that also this approach (as well as your approach) only shows Activities that actually have an Activity Party.
just wondering if your activity party conditions should be grouped under "OR".. otherwise, it's "AND" altogether, so you are currently looking for the activities where your activity party is both a sender and a recipient.. In other words, maybe this would work?
You need to go deeper:
(pardon the ASCII art, don't have a screenshot at hand now: this is how the advanced find window should look)
Look for: Activities
Activity Type Equals E-Mail;...
(put all the other conditions here)
Activity Parties (Activity)
Participation Type Equals Sender;To Recipient
Party(User)
Full Name Does Not Contain test
In this PoC I'm assuming all parties are System Users. You cannot mix different kinds of activity parties (such as, an e-mail sent to a contact).

API to display filled in tags in PNG format

We are looking for a way to have functionality similar to the following api method which returns a requested page in PNG format (non editable format):
https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST API References/Get a Page Image.htm
but with the ability to display the values for any custom, etc. tags that have been filled in. Currently, no tags or values are displayed regardless of whether they have been filled in.
Does any know a way to do this?
I don't believe you can bring back the tab values with the page image when the envelope is still in process, I think only completed envelopes will show that info.
You'll most likely have to make a separate API call to retrieve the recipient entered tab values. Have a look at the Get Envelope Recipient Status API call, and more importantly, it's one optional parameter. Details of the call are:
URL:
/accounts/{accountId}/envelopes/{envelopeId}/recipients
HTTP Method:
GET
Parameters:
The only required parameter is the envelope ID. If the optional query include_tabs is set to true, the tabs associated with the recipient are returned. If the optional query include_extended is set to true, the extended properties are returned.

Resources