Track Envelopes which have used “Change Signer” option - docusignapi

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).

Related

MS Teams / SharePoint / Power automate Flow - post adaptive card in channel - remove flow owner

is there a way to amend the layout of the adaptive card that is posted by a flow bot in a channel in MS Teams?
The current layout of the adaptive card:
I'd like to remove the flow owner's name from the adaptive card or switch it with the "Created by" user's name (Display Name).
The flow is triggered whenever a user adds a new item into the team's calendar on SharePoint (a SharePoint list, basically).
Here's the current flow setup:
Here's the Adaptive Card action's code:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Update from Sharepoint",
"spacing": "Medium",
"size": "Large",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "An item was added/modified in Sharepoint calendar",
"size": "Medium",
"spacing": "None"
},
{
"type": "FactSet",
"facts": [
{
"title": "Title",
"value": "#{triggerOutputs()?['body/Title']}"
},
{
"title": "Description",
"value":"#{body('Html_to_text')}"
},
{
"title": "Category",
"value":"#{triggerOutputs()?['body/Category/Value']}"
},
{
"title": "Created by",
"value": "[#{triggerOutputs()?['body/Editor/DisplayName']}](https://teams.microsoft.com/l/chat/0/0?users=#{triggerOutputs()?['body/Editor/Email']})"
},
{
"title": "From",
"value": "#{triggerOutputs()?['body/EventDate']}"
},
{
"title": "To",
"value": "#{triggerOutputs()?['body/EndDate']}"
},
]
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.OpenUrl",
"title": "View list",
"url": "#{triggerOutputs()?['body/{Link}']}"
}
]
}
],
"version": "1.2",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
Thanks for any advice.

Include query results in application insights alert to webhook

I try to setup an application insights alert to a webhook (MS Teams to be precise). I already successfully managed to create the alert and the data is already sent to the webhook and displayed in Teams.
This is a log-alert.
All I am now missing is the query-RESULT of that log-alert.
The documentation [https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-log-webhook#log-alert-with-a-custom-json-payload] simply states that I need to add a simple configuration-parameter into the payload:
"IncludeSearchResults":true
Which I did. But still no Json-Attachment (or anything else) to be seen containing the query result.
My complete payload (which works fine apart from the result-part) looks like this:
{
"#context": "http://schema.org/extensions",
"#type": "MessageCard",
"IncludeSearchResults":true,
"themeColor": "CC4216",
"title": "#alertrulename",
"text": "#alertrulename returned #searchresultcount records which exceeds the threshold of #thresholdvalue .",
"summary": "Query: #searchquery",
"potentialAction": [{
"#type": "OpenUri",
"name": "See details in AppInsights",
"targets": [{
"os": "default",
"uri": "#linktosearchresults"
}]
}],
"sections": [{
"facts": [{
"name": "Severity:",
"value": "#severity"
},
{
"name": "Query:",
"value": "#searchquery"
},
{
"name": "ResultCount:",
"value": "#searchresultcount"
},
{
"name": "Search Interval StartTime:",
"value": "#searchintervalstarttimeutc"
},
{
"name": "Search Interval End time:",
"value": "#searchintervalendtimeutc"
},
{
"name": "AppInsights Application ID:",
"value": "#applicationid"
}]
}]
}
What I want to achieve is that the "top 10 results" that are automatically added to any email-notification also be shown in Teams:
O365 connector card schema does not contain IncludeSearchResults property.
You will need to fetch the result and then bind the data to card.
Are you able to fetch the results?

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" }
]
},
]
}

Docu Sign Rest API Sender View Issue for in Process Envelope

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

Discovery Document for Google Email Migration API v2?

Today Google announced a new version of the Email Migration API. The API appears to follow Google's normal REST format but I've been unable to determine the service name and version information for the API in order to use it with the google-api-python-client.
Is there a discovery document for the new API and if so what is the service name and version?
The discovery document was slightly delayed from the actual release, but it's now available through the discovery service or directly here.
For now, I've been able to write my own non-standard discovery document. It's probably buggy/incomplete but it's working for me for test messages and the Python API Client.
{
"kind": "discovery#restDescription",
"etag": "\"BgGz67p-6wsAbOn4St98QhtBGbA/blODPd9XLaVQKZp7pexaIpilnaw\"",
"discoveryVersion": "v1",
"id": "emailmigration:v2",
"name": "emailmigration",
"version": "v2",
"revision": "20130717",
"title": "Email Migration API",
"description": "API to migrate messages to Google Apps Gmail Accounts",
"ownerDomain": "google.com",
"ownerName": "Google",
"documentationLink": "https://developers.google.com/admin-sdk/email-migration/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/email/v2/",
"basePath": "/email/v2/users/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "email/v2/users/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/email.migration": {
"description": "Write access to Email Migration API v2."
}
}
}
},
"schemas": {
"Mail": {
"id": "Mail",
"type": "object",
"description": "The metadata for a mail message.",
"properties": {
"isDraft": {
"type": "boolean",
"description": "The message is marked as a draft when migrated to the Gmail mailbox."
},
"isInbox": {
"type": "boolean",
"description": "The message should appear in the Inbox, regardless of its labels. By default, a migrated mail message will appear in the Inbox only if it has no labels."
},
"isSent": {
"type": "boolean",
"description": "The message is marked as \"Sent Mail\" when migrated to the Gmail mailbox."
},
"isStarred": {
"type": "boolean",
"description": "The message is starred when migrated."
},
"isTrash": {
"type": "boolean",
"description": "The message is marked as \"Trash\" when migrated."
},
"isUnread": {
"type": "boolean",
"description": "The message is marked as unread when migrated. Without this property, a migrated mail message is marked as read."
},
"isDeleted": {
"type": "boolean",
"description": "The message is migrated directly into Google Vault. Once archived in Google Vault, the message is only visible to a Vault administrator."
},
"labels": {
"type": "array",
"description": "The labels applied to the message when migrated.",
"items": {
"type": "string"
}
}
}
}
},
"resources": {
"mail": {
"methods": {
"insert": {
"id": "emailmigration.mail.insert",
"path": "{userKey}/mail",
"httpMethod": "POST",
"description": "Insert a Mail resource into a user's Gmail account.",
"parameters": {
"userKey": {
"type": "string",
"description": "The email address or email alias of the user's mailbox to migrate the message to.",
"required": true,
"location": "path"
}
},
"request": {
"$ref": "Mail"
},
"scopes": [
"https://www.googleapis.com/auth/email.migration"
],
"supportsMediaUpload": true,
"mediaUpload": {
"accept": [
"message/rfc822"
],
"maxSize": "32MB",
"protocols": {
"simple": {
"multipart": true,
"path": "/upload/email/v2/users/{userKey}/mail"
},
"resumable": {
"multipart": true,
"path": "/upload/email/v2/users/{userKey}/mail"
}
}
}
}
}
}
}
}

Resources