Docu Sign Rest API Sender View Issue for in Process Envelope - docusignapi

We are trying to use embedded signing to display the sender view in iframe.
If an envelope has 2 signers and one of them have signed the envelope we want to display the current state of the envelope to the sender.
Is there any API available to display current state of envelope to the sender.

Per the comment that you've added to your answer, the simplest way to retreive current status of all recipients for an Envelope is the GET Recipients API call:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/recipients?include_tabs=false&include_extended=false
The response will contain an array of recipient objects for each recipient type, and each recipient object has a status property that indicates the current status of the recipient. For example, here's a response for an Envelope that contains 2 Signers -- the first has Completed signing, the second has not (status=delivered):
{
"signers": [
{
"signInEachLocation": "false",
"name": "Abby Adams",
"email": "abby#outlook.com",
"recipientId": "04cdba57-5383-4917-9081-e9dad16ba8a9",
"recipientIdGuid": "04cdba57-5383-4917-9081-e9dad16ba8a9",
"requireIdLookup": "false",
"userId": "1860fbdc-96ee-4d14-8353-c0213cd2728f",
"routingOrder": "1",
"roleName": "Signer 1",
"status": "completed",
"signedDateTime": "2014-04-24T14:00:10.5800000Z",
"deliveredDateTime": "2014-04-24T13:59:35.2330000Z",
"templateLocked": "false",
"templateRequired": "false"
},
{
"signInEachLocation": "false",
"name": "Adam Smith",
"email": "adam#outlook.com",
"recipientId": "fb3708f5-552f-410e-8029-9abbb5214196",
"recipientIdGuid": "fb3708f5-552f-410e-8029-9abbb5214196",
"requireIdLookup": "false",
"userId": "ecd6f430-5c08-4a4c-876e-ba7ad95f13dc",
"routingOrder": "2",
"status": "delivered",
"deliveredDateTime": "2014-04-24T14:00:28.1930000Z"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2",
"currentRoutingOrder": "2"
}
If you need more detailed audit trail information, you can use the GET Audit Events API call:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/audit_events
The Response to this request will contain an array of auditEvent objects. Each auditEvent object is composed of a single property -- eventFields -- which is an array of name/value pairs.
For example, the following response shows that Mary Smith created the envelope and sent the envelope, and then John Doe viewed the envelope and declined the envelope:
{
"auditEvents": [
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:07:52.7741974Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Mary Smith"
},
{
"name": "UserId",
"value": "bc266e97-83a6-472c-XXXX-ebad10e4cc6a"
},
{
"name": "Action",
"value": "Registered"
},
{
"name": "Message",
"value": "The envelope was created by Mary Smith"
},
{
"name": "EnvelopeStatus",
"value": "created"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": ""
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
},
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:07:53.6321919Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Mary Smith"
},
{
"name": "UserId",
"value": "bc266e97-83a6-472c-a25b-ebad10e4cc6a"
},
{
"name": "Action",
"value": "Sent Invitations"
},
{
"name": "Message",
"value": "Mary Smith sent an invitation to John Doe [john#outlook.com]"
},
{
"name": "EnvelopeStatus",
"value": "sent"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": "John Doe [john#outlook.com]"
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
},
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:12:17.9412976Z"
},
{
"name": "Source",
"value": "web"
},
{
"name": "UserName",
"value": "John Doe"
},
{
"name": "UserId",
"value": "03c8a856-c0ae-41bf-943d-ac6e92db66a8"
},
{
"name": "Action",
"value": "Viewed"
},
{
"name": "Message",
"value": "John Doe viewed the envelope [documents:(Mutual NDA with anchors.pdf)]"
},
{
"name": "EnvelopeStatus",
"value": "sent"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": "John Doe viewed the envelope [documents:(Mutual NDA with anchors.pdf)]"
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
},
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:12:30.3432181Z"
},
{
"name": "Source",
"value": "web"
},
{
"name": "UserName",
"value": "John Doe"
},
{
"name": "UserId",
"value": "03c8a856-c0ae-41bf-943d-ac6e92db66a8"
},
{
"name": "Action",
"value": "Declined"
},
{
"name": "Message",
"value": "John Doe declined the envelope [Reason: I changed my mind.]"
},
{
"name": "EnvelopeStatus",
"value": "declined"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": "Reason: I changed my mind."
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
}
]
}
The DocuSign REST API Guide (https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/rest-api-guide-v2.pdf) contains information about both of the API calls.
--- UPDATE ---
You can retrieve an Envelope's document(s) at any time (i.e., regardless of signer/envelope status) by using the "GET Envelope Documents" API request:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/documents/combined
The response will contain a byte stream that represents the contents of the Envelope document(s) in PDF format -- your application can then simply write that byte stream to the browser to display the document(s). See page 177 of the REST API Guide for details about this operation.
Regarding your question about customizing the "Embedded Sender View" -- it's not possible to customize the Sender view via the API -- i.e., an 'embedded Sender will always have the ability to do everything that they'd be able to do if sending directly via the DocuSign web console.

Once a DocuSign envelope is in progress (meaning it has been sent and is NOT in draft state) then you can not generate the sender view. The sender view is used to tag the envelope, and if the envelope has already been sent then no more tagging is allowed.
So to answer your question, no it's not possible to generate a sender view on a sent envelope, it's only possible to generate a signing URL at that point, and you can only generate the signing URL for recipients who have their clientUserId property set.
More on Embedded Signing here:
https://www.docusign.com/developer-center/explore/features/embedding-docusign

Related

DocuSign: Is there a way to set custom fields in the document in a template and then later replace with unique values while creating the envelope?

What I want is to place the custom fields at document level while creating the template so that later I can have unique values for every envelope that is created. These values should be visible to all the recipients.
These are the steps that I currently follow:
Create Document Custom Fields/Tab Definitions at the Account level.
Create the template from our app and navigate to DocuSign to place the above created custom fields on the document (it is signer specific).
Save the template.
At a later stage, choose the template in our app and create an envelope with the template ID, templateRoles (with custom fields' values for signer), status etc. like below:
{
"templateId": "1e6c1118-1234-1244-1244-c4a11111775b",
"templateRoles": [
{
"roleName": "Signer1",
"name": "Signer1",
"email": "Signer1#Signer1.com",
"tabs": {
"textTabs": [
{
"tabLabel": "Account.Name",
"value": "account-name777"
},
{
"tabLabel": "Candidate.FullName",
"value": "candidate-name1234"
},
{
"tabLabel": "Candidate.Mobile",
"value": "0412347777"
}
]
}
},
{
"roleName": "Signer2",
"name": "Signer2",
"email": "Signer2#Signer2.com",
"tabs": {
"textTabs": [
{
"tabLabel": "Account.Name",
"value": "account-name777"
},
{
"tabLabel": "Candidate.FullName",
"value": "candidate-name1234"
},
{
"tabLabel": "Candidate.Mobile",
"value": "0412347777"
}
]
}
}
],
"status": "sent"
}
The above works for Signer1 but does not show the custom fields' values to Signer2. The custom fields need to be exactly the same for all recipients. Is there a way to achieve this?
Also what I noticed was after Signer1 signs the document then the custom fields' values show to Signer2.
Change the tabLabels so they are not the same, here is the code:
{
"templateId": "1e6c1118-1234-1244-1244-c4a11111775b",
"templateRoles": [
{
"roleName": "Signer1",
"name": "Signer1",
"email": "Signer1#Signer1.com",
"tabs": {
"textTabs": [
{
"tabLabel": "Account.Name1",
"value": "account-name777"
},
{
"tabLabel": "Candidate.FullName1",
"value": "candidate-name1234"
},
{
"tabLabel": "Candidate.Mobile1",
"value": "0412347777"
}
]
}
},
{
"roleName": "Signer2",
"name": "Signer2",
"email": "Signer2#Signer2.com",
"tabs": {
"textTabs": [
{
"tabLabel": "Account.Name2",
"value": "account-name777"
},
{
"tabLabel": "Candidate.FullName2",
"value": "candidate-name1234"
},
{
"tabLabel": "Candidate.Mobile2",
"value": "0412347777"
}
]
}
}
],
"status": "sent"
}

How to fix "it doesn't support that" when I query Alexa retrievable property

I have this endpoint with powerState and connectivity properties both retrievable:
{
"endpointId": "123",
"manufacturerName": "abc",
"friendlyName": "lamp",
"description": "lamp",
"displayCategories": [
"LIGHT"
],
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [{
"name": "powerState"
}],
"retrievable": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.EndpointHealth",
"version": "3",
"properties": {
"supported": [{
"name": "connectivity"
}],
"retrievable": true
}
}
],
"cookie": {}
}
I respond to ReportState request by sending the state of both properties:
{
"context": {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2019-01-10T10:17:19.99Z",
"uncertaintyInMilliseconds": 50
},
{
"namespace": "Alexa.EndpointHealth",
"name": "connectivity",
"value": {
"value": "OK"
},
"timeOfSample": "2019-01-10T10:17:19.90Z",
"uncertaintyInMilliseconds": 50
}
]
},
"event": {
"header": {
"namespace": "Alexa",
"name": "StateReport",
"payloadVersion": "3",
"messageId": "cde",
"correlationToken": "efg123"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "ab123"
},
"endpointId": "123",
"cookie": {}
},
"payload": {}
}
}
And I send the same context in the PowerController response.
In the Alexa app I can see my device, turn it on and off and view its state rightly. I can ask Alexa to turn on and off my device and the response in "OK", but if I try to ask:** "Is my device turned on?" ** Alexa answers that this device doesn't support that.
The skill language is Italian and PowerController documentation https://developer.amazon.com/it/docs/device-apis/alexa-powercontroller.html says that query is supported.
What am I missing?

Creating a Meeting in JSON Format issue

Is there any way to create a Calendar entry using a mailfile where the Organizer is not the mailfile Owner?
For example:
http://mycompanycom/mail/utils.nsf/api/calendar/events
I want to use a gereric mailfile where DAS is enabled and make all request against it; otherwise I'll need to query every Organizer's mailfile.
The only way I can make it to work is when I set the organizer the same as the mailfile owner, for example:
http://mycompany.com/mail1/ndev1.nsf/api/calendar/events
Here Notes Dev1 is the Owner for ndev1.nsf
{
"events": [
{
"summary": "TEST FEB 2018",
"location": "TEST LOCATION - NOT NEEDED",
"description": "",
"CalendarDateTime": {
"date": "2018-02-26",
"time": "17:00:00",
"utc": true
},
"start": {
"date": "2018-02-26",
"time": "17:00:00",
"utc": true
},
"end": {
"date": "2018-02-26",
"time": "18:00:00",
"utc": true
},
"class": "public",
"transparency": "opaque",
"sequence": 0,
"x-lotus-noticetype": "I",
"attendees": [
{
"role": "chair",
"status": "accepted",
"rsvp": false,
"displayName": "Notes Dev1/MYCOMPANY",
"email": "notes.dev1#mycompany.com"
},
{
"role": "req-participant",
"status": "needs-action",
"rsvp": true,
"displayName": "Pablo Solano/MYCOMPANY",
"email": "pablo.solano#mycompany.com"
},
{
"role": "req-participant",
"status": "needs-action",
"rsvp": true,
"displayName": "Notes Dev2/MYCOMPANY",
"email": "notes.dev2#mycomany.com"
},
{
"role": "req-participant",
"userType": "room",
"status": "accepted",
"rsvp": true,
"email": "maar#teradyne.com"
}
],
"organizer": {
"displayName": "Notes Dev1/MYCOMPANY",
"email": "notes.dev1#mycompany.com"
}
}
]
}
I found this url: http://www-10.lotus.com/ldd/ndseforum.nsf/xpTopicThread.xsp?documentId=CB20A0E36EE82AB385258154003B0A86
with this text:
One important caveat: The organizer property must match the owner of the database as specified in the request URL (/{database}/api/calendar/events).
I see few options for you:
Quick&dirty - change/add current user as owner of the calendar on the fly every time. Not recommended.
Make your code to work on behalf of universal identity, which is also owner of the calendar. Caveat: meeting will be arranged by that identity.
Create the meeting from user's calendar. Probably that's not what you want.

How to track Signer's IP Address in DocuSign

We need a IP address of Signer for audit purpose. So how we can track a IP of signer apart form certificate of completion.
Use the listAuditEvents api to retrieve the envelope audit history. ClientIPAddress is one of the properties present in the envelope audit history.
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/audit_events
{
"auditEvents": [
{
"eventFields": [
{ "name": "logTime", "value": "2017-05-12T14:27:20.3541245Z" },
{ "name": "UserName", "value": "Jane Doe" },
{ "name": "UserId", "value": "c780706d-ac28-45a8-9c05-4adc6860e488" },
{ "name": "Action", "value": "Signed" },
{ "name": "Message", "value": "The envelope was Signed by Jane Doe" },
{ "name": "EnvelopeStatus", "value": "created" },
{ "name": "ClientIPAddress", "value": "128.384.222.11" },
{ "name": "Language", "value": "english" }
]
},
]
}

Track Envelopes which have used “Change Signer” option

How to track Envelopes which have used “Change Signer” option in DocuSign API c#?
Not sure it's possible to do a search for (i.e., retrieve envelopeIds) for all envelopes where "Change Signer" event has occurred. However, to determine whether the "Change Signer" event has occurred for a specific envelope, you can use the Get Envelope Audit Events operation (REST API):
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/audit_events
If a "Change Signer" event has occured for the specified envelope, the API response will contain info about this event:
{
"auditEvents": [
...
{
"eventFields": [
{
"name": "logTime",
"value": "2014-02-27T14:41:36.0380469Z"
},
{
"name": "Source",
"value": "web"
},
{
"name": "UserName",
"value": "John Doe"
},
{
"name": "Action",
"value": "Reassign"
},
{
"name": "Message",
"value": "John Doe reassigned the envelope to Mary Smith [marysemail#outlook.com] routing order 1"
},
{
"name": "EnvelopeStatus",
"value": "sent"
},
{
"name": "ClientIPAddress",
"value": "65.11.28.123"
},
{
"name": "Information",
"value": "Mary Smith [marysemail#outlook.com] routing order 1"
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
...
}
]
The response will contain info for all events that have occured for the specified envelope -- the "Change Signer" event is the one where Action = Reassign (as shown above). See the REST API guide (p127) for more info about the Get Envelope Audit Events operation (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf).

Resources