How to handle print and sign event notifications from docusign api? - docusignapi

We have event notifications set up to send us a notification request for user actions.
I am trying to validate the document status to figure out if an user has signed a document. When the user has signed the document using docusign, I can capture the status from TabStatuses in the request.
However, I am not unable to figure out a way to handle the scenario where an user has opted to print and sign as the response for Print and Sign notifications does not include the TabStatuses with the status.
I have tried to go through the documentation to figure out if there is a way to confirm that the user has opted to print and sign the document, but I couldn't find what I was looking for. I do get DocumentStatus which returns a name node signed_on_paper_<reference_id> but it doesn't seem like the best approach to validate that the user has opted to print and sign.
Also in the case of multiple signers, what would be the best way to identify the status of each signer.
Sample response I received when a user opted to print and sign:
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>
Signer
</Type>
<Email>
sdasari#plxs.com.au
</Email>
<UserName>
Shyam Dasari
</UserName>
<RoutingOrder>
1
</RoutingOrder>
<Sent>
2019-10-15T16:23:38.06
</Sent>
<Delivered>
2019-10-15T16:23:50.15
</Delivered>
<Signed>
2019-10-15T16:24:35.167
</Signed>
<DeclineReason xsi:nil="true" />
<Status>
Completed
</Status>
<RecipientIPAddress>
115.70.163.1
</RecipientIPAddress>
<ClientUserId>
7422
</ClientUserId>
<CustomFields />
<AccountStatus>
Active
</AccountStatus>
<EsignAgreementInformation>
<AccountEsignId>
e17f1e7a-2d2f-49e7-bdc6-gibberish
</AccountEsignId>
<UserEsignId>
75eda468-405c-48a3-bf8c-gibberish
</UserEsignId>
<AgreementDate>
2019-10-15T16:23:50.15
</AgreementDate>
</EsignAgreementInformation>
<RecipientId>
e1e8e99a-b89f-4d5c-aa27-gibberish
</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>
2019-10-15T16:24:55.6107604
</TimeGenerated>
<EnvelopeID>
530aa34b-1991-4bc6-b374-gibberish
</EnvelopeID>
<Subject>
Shyam Dasari has sent you a document to review and sign
</Subject>
<UserName>
Legal Gateway Sandbox
</UserName>
<Email>
callum#testsoftware.com.au
</Email>
<Status>
Completed
</Status>
<Created>
2019-10-15T16:23:37.67
</Created>
<Sent>
2019-10-15T16:23:38.093
</Sent>
<Delivered>
2019-10-15T16:23:50.307
</Delivered>
<Signed>
2019-10-15T16:24:35.167
</Signed>
<Completed>
2019-10-15T16:24:35.167
</Completed>
<ACStatus>
Original
</ACStatus>
<ACStatusDate>
2019-10-15T16:23:37.67
</ACStatusDate>
<ACHolder>
Legal Gateway Sandbox
</ACHolder>
<ACHolderEmail>
callum#test.com.au
</ACHolderEmail>
<ACHolderLocation>
DocuSign
</ACHolderLocation>
<SigningLocation>
Online
</SigningLocation>
<SenderIPAddress>
115.70.163.1
</SenderIPAddress>
<EnvelopePDFHash />
<CustomFields>
<CustomField>
<Name>
AccountId
</Name>
<Show>
false
</Show>
<Required>
false
</Required>
<Value>
12345
</Value>
<CustomFieldType>
Text
</CustomFieldType>
</CustomField>
<CustomField>
<Name>
AccountName
</Name>
<Show>
false
</Show>
<Required>
false
</Required>
<Value>
Legal Gateway
</Value>
<CustomFieldType>
Text
</CustomFieldType>
</CustomField>
<CustomField>
<Name>
AccountSite
</Name>
<Show>
false
</Show>
<Required>
false
</Required>
<Value>
demo
</Value>
<CustomFieldType>
Text
</CustomFieldType>
</CustomField>
</CustomFields>
<AutoNavigation>
true
</AutoNavigation>
<EnvelopeIdStamping>
true
</EnvelopeIdStamping>
<AuthoritativeCopy>
false
</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>
4321
</ID>
<Name>
sid_0a_2s_rando_doc_2_1405
</Name>
<TemplateName />
<Sequence>
1
</Sequence>
<DocumentFields>
<DocumentField>
<Name>
reference_id
</Name>
<Value>
gibberish:1iKFJ0:gibberish-Cw
</Value>
</DocumentField>
</DocumentFields>
</DocumentStatus>
<DocumentStatus>
<ID>
2
</ID>
<Name>
Signed-on-Paper_more-gibberish-aa27-bafd4d393c02
</Name>
<TemplateName />
<Sequence>
2
</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
If a user opted to sign using docusign's esignature, I get TabStatuses in the response which help me identify the current state of the document.
<TabStatuses>
<TabStatus>
<TabType>
SignHere
</TabType>
<Status>
Signed
</Status>
<XPosition>
699
</XPosition>
<YPosition>
754
</YPosition>
<TabLabel>
Signature 1_SignHere_gibberish_id
</TabLabel>
<TabName />
<DocumentID>
2460
</DocumentID>
<PageNumber>
1
</PageNumber>
</TabStatus>
</TabStatuses>
I am using the docusign api version 2.

When a user signs on paper there are no tabs.
Moreover, there's no way for you to know what paper was actually signed.
When the envelope is complete, you'll find an additional document in it, which is the paper that was faxed into the system. That is the only information you get back from a user that signs on paper.
(We strongly discourage use of paper, and if one uses it - there are certain limitations to what we can support).

Related

Amazon returns 0 TotalOffers for valid ASIN

ASIN: B000XETPPY
I'm using the Amazon scratchpad, so I'm not even coding. Here is the response:
<Items>
<Request>
<IsValid>True</IsValid>
<ItemLookupRequest>
<IdType>ASIN</IdType>
<ItemId>B000XETPPY</ItemId>
<ResponseGroup>OfferFull</ResponseGroup>
<VariationPage>All</VariationPage>
</ItemLookupRequest>
</Request>
<Item>
<ASIN>B000XETPPY</ASIN>
<ParentASIN>B000XETPPY</ParentASIN>
<OfferSummary>
<TotalNew>0</TotalNew>
<TotalUsed>0</TotalUsed>
<TotalCollectible>0</TotalCollectible>
<TotalRefurbished>0</TotalRefurbished>
</OfferSummary>
<Offers>
<TotalOffers>0</TotalOffers>
<TotalOfferPages>0</TotalOfferPages>
<MoreOffersUrl>0</MoreOffersUrl>
</Offers>
</Item>
</Items>
However, the ASIN is for this popular product: http://www.amazon.com/Timberland-PRO-Mens-Pitboss-Steel-Toe/dp/B000XETPPY
Why is it saying 0 TotalOffers?
The call I'm using is ItemLookup and the response group is OfferFull.

DocumentID ignored in AnchorTab's in multiple document envelope

I found another post on this topic however noone has answered that post and I wasn't able to add my comments to it.
I am testing a multi-document / multi-signer scenario via the SOAP API. I have 2 documents, each with 2 signer fields tagged with values recipient1Sign and recipient2Sign respectively. I have specified AnchorTabStrings for the signer fields on my xml to correlate with the anchor tags on the forms (see sample xml below). I'm finding that the Tab definition and it's associated DocumentID does not provide scoping for the AnchorTabString when DocuSign adds the signer tags to the form meaning that if different recipients on different doucuments use tabs that have AnchorTabStrings with the same value, both recipients see signer tabs on both documents. In other words, the tab definition and its corresponding AnchorTabString definitions are not being considered unique within the envelope. The DocuSign documentation pretty clearly states that the AnchorTabString definition is supposed to be scoped to a document (which is what I want), not scoped at the envelope level (which is what my testing is showing).
I've included excerpts of the recipeint and tab definitions being used in my testing below.
<ns1:Recipients>
<ns1:Recipient>
<ns1:ID>1</ns1:ID>
<ns1:UserName>John Doe</ns1:UserName>
<ns1:SignerName>John Doe</ns1:SignerName>
<ns1:Email>johndoe#abc.com</ns1:Email>
<ns1:Type>Signer</ns1:Type>
<ns1:RequireIDLookup>false</ns1:RequireIDLookup>
<ns1:RoutingOrder>1</ns1:RoutingOrder>
</ns1:Recipient>
<ns1:Recipient>
<ns1:ID>2</ns1:ID>
<ns1:UserName>Jane Doe</ns1:UserName>
<ns1:SignerName>Jane Doe</ns1:SignerName>
<ns1:Email>janedoe#xyz.com</ns1:Email>
<ns1:Type>Signer</ns1:Type>
<ns1:RequireIDLookup>false</ns1:RequireIDLookup>
<ns1:RoutingOrder>1</ns1:RoutingOrder>
</ns1:Recipient>
<ns1:Recipient>
<ns1:ID>3</ns1:ID>
<ns1:UserName>Jack Doe</ns1:UserName>
<ns1:SignerName>Jack Doe</ns1:SignerName>
<ns1:Email>jackdoe#xyz.com</ns1:Email>
<ns1:Type>Signer</ns1:Type>
<ns1:RequireIDLookup>false</ns1:RequireIDLookup>
<ns1:RoutingOrder>1</ns1:RoutingOrder>
</ns1:Recipient>
</ns1:Recipients>
The example requires definition of 2 documents in the XML:
<ns1:Documents>
<ns1:Document>
<ns1:ID>1</ns1:ID>
<ns1:Name>Test Doc 1</ns1:Name>
<ns1:PDFBytes>JVBERi0xLjcNJeLjz</ns1:PDFBytes>
<ns1:TransformPdfFields>true</ns1:TransformPdfFiel​ds>
<ns1:FileExtension>PDF</ns1:FileExtension>
</ns1:Document>
<ns1:Document>
<ns1:ID>2</ns1:ID>
<ns1:Name>Test Doc 2</ns1:Name>
<ns1:PDFBytes>9MNCjExIDAgb2Jq</ns1:PDFBytes>
<ns1:TransformPdfFields>true</ns1:TransformPdfFiel​ds>
<ns1:FileExtension>PDF</ns1:FileExtension>
</ns1:Document>
</ns1:Documents>
The example requires definition of signer tabs in the xml:
<ns1:Tab>
<ns1:DocumentID>1</ns1:DocumentID>
<ns1:RecipientID>1</ns1:RecipientID>
<ns1:ScaleValue>50</ns1:ScaleValue>
<ns1:AnchorTabItem>
<ns1:AnchorTabString>recipient1Sign</ns1:AnchorTabString>
<ns1:IgnoreIfNotPresent>true</ns1:IgnoreIfNotPrese​nt>
</ns1:AnchorTabItem>
<ns1:Type>SignHere</ns1:Type>
<ns1:TabLabel>Customer</ns1:TabLabel>
<ns1:TemplateLocked>true</ns1:TemplateLocke​d>
<ns1:TemplateRequired>false</ns1:TemplateRequired>
</ns1:Tab>
<ns1:Tab>
<ns1:DocumentID>1</ns1:DocumentID>
<ns1:RecipientID>2</ns1:RecipientID>
<ns1:ScaleValue>50</ns1:ScaleValue>
<ns1:AnchorTabItem>
<ns1:AnchorTabString>recipient2Sign</ns1:AnchorTabString>
<ns1:IgnoreIfNotPresent>true</ns1:IgnoreIfNotPrese​nt>
</ns1:AnchorTabItem>
<ns1:Type>SignHere</ns1:Type>
<ns1:TabLabel>Representative</ns1:TabLabel>
<ns1:TemplateLocked>true</ns1:TemplateLocked>
<ns1:TemplateRequired>false</ns1:TemplateRequired>
</ns1:Tab>
<ns1:Tab>
<ns1:DocumentID>2</ns1:DocumentID>
<ns1:RecipientID>1</ns1:RecipientID>
<ns1:ScaleValue>50</ns1:ScaleValue>
<ns1:AnchorTabItem>
<ns1:AnchorTabString>recipient1Sign</ns1:AnchorTabString>
<ns1:IgnoreIfNotPresent>true</ns1:IgnoreIfNotPrese​nt>
</ns1:AnchorTabItem>
<ns1:Type>SignHere</ns1:Type>
<ns1:TabLabel>Owner</ns1:TabLabel>
<ns1:TemplateLocked>true</ns1:TemplateLocked>
<ns1:TemplateRequired>false</ns1:TemplateRequired>
</ns1:Tab>
<ns1:Tab>
<ns1:DocumentID>2</ns1:DocumentID>
<ns1:RecipientID>3</ns1:RecipientID>
<ns1:ScaleValue>50</ns1:ScaleValue>
<ns1:AnchorTabItem>
<ns1:AnchorTabString>recipient2Sign</ns1:AnchorTabString>
<ns1:IgnoreIfNotPresent>true</ns1:IgnoreIfNotPrese​nt>
</ns1:AnchorTabItem>
<ns1:Type>SignHere</ns1:Type>
<ns1:TabLabel>Payer</ns1:TabLabel>
<ns1:TemplateLocked>true</ns1:TemplateLocked>
<ns1:TemplateRequired>false</ns1:TemplateRequired>
</ns1:Tab>
</ns1:Tabs>
..

XML parsing for nested tags using python

i would need a help on how to parse xml files with nested tags taking the user input as attribute value of a particular tag.
for eg:
if xml code has 12 mappings and we want to select the below mapping name "m_IF1_TD_SALESORDER_STG_PR4_VBPA_BUSINESS_PARTNER" as user input and thereby printing the particular mapping details.
<MAPPING NAME="m_IF1_TD_SALESORDER_STG_PR4_VBPA_BUSINESS_PARTNER" DESCRIPTION="Data Mapping for loading Sales Order Business Partners from the staging database for PR4." OBJECTVERSION="1" ISVALID="YES" VERSIONNUMBER="1">
<TRANSFORMATION NAME="sq_STG_PR4_VBPA" DESCRIPTION="" TYPE="Source Qualifier" OBJECTVERSION="1" REUSABLE="NO" VERSIONNUMBER="1">
<TRANSFORMFIELD NAME="MANDT" DESCRIPTION="" DATATYPE="string" PORTTYPE="INPUT/OUTPUT" PRECISION="3" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="MANDT" EXPRESSIONTYPE="GENERAL"/>
<TRANSFORMFIELD NAME="VBELN" DESCRIPTION="" DATATYPE="string" PORTTYPE="INPUT/OUTPUT" PRECISION="10" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="VBELN" EXPRESSIONTYPE="GENERAL"/>
<TRANSFORMFIELD NAME="POSNR" DESCRIPTION="" DATATYPE="decimal" PORTTYPE="INPUT/OUTPUT" PRECISION="6" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="POSNR" EXPRESSIONTYPE="GENERAL"/>
<TRANSFORMFIELD NAME="PARVW" DESCRIPTION="" DATATYPE="string" PORTTYPE="INPUT/OUTPUT" PRECISION="2" SCALE="0" PICTURETEXT="" DEFAULTVALUE="" EXPRESSION="PARVW" EXPRESSIONTYPE="GENERAL"/>
I would suggest using the XML ElementTree module of python.
It is very simple to use. For example:
import xml.etree.ElementTree as ET
tree = ET.parse('/filename.xml')
root = tree.getroot()
for subchild in root.findall('subchildName'):
print(subchild.get('subchildAttribute')

CRM 2011 FetchXml to pull list accounts and display only most recent activity dates

I am trying to create a report in fetchxml on crm 2011 that displays a list of Account Names, and also in the same row displays the date of ONLY the most recent activity for that account.
So
Report should look like
Account1, Date of most recent activity for Account 1
Account2, Date of most recent activity for Account 2
Account3, Date of most recent activity for Account 3
I have a fetch query that pulls the correct data, but it pulls a row for each activity for the account instead of just for the newest activity.
so it looks like
Account1, Date of most recent activity for Account 1
Account1, Date of other activity for Account 1
Account2, Date of most recent activity for Account 2
Account2, Date of other activity for Account 2
Account3, Date of most recent activity for Account 3
Here is my fetch
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" aggregate="false">
<entity name="<accountentityname>"
<attribute name="<accountname>" />
<link-entity name="activity" from="<regardingaccoutnfield>" to="<account field>" visible="false" link-type="outer">
<attribute name="<date of activity>" />
</link-entity>
</entity>
</fetch>
Any suggestions?
Thanks.
Not sure if the maxaggregate attribute will work with datetimes, but if it does that might work
What you're wanting to do requires a subquery. This is something that CRM does not support.
If you're not using CRM Online, just perform a standard SSRS query using SQL rather then FetchXml.
If you're just trying to pull back data with the SDK, you could perform the subquery on the client side.
Why Max Aggregate Won't Work
If your column you were wanting to get the max value on was a number you could use an aggregate, but Aggregate functions AVG, MIN, MAX, or SUM can only be applied to attributes of type integer, float, money, bigint, or decimal.
That's the error if you attempt to run this query:
var xml = #"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true' aggregate='true'>
<entity name='contact'>
<attribute name='fullname' alias='name' groupby='true' />
<attribute name='contactid' alias='id' groupby='true' />
<link-entity name='activitypointer' from='regardingobjectid' to='contactid' alias='ad' link-type='outer'>
<attribute name='createdon' alias='createdon_max' aggregate='max' />
<filter type='and'>
<condition attribute='createdon' operator='not-null' />
</filter>
</link-entity>
</entity>
</fetch>";
EntityCollection fetchResult = service.RetrieveMultiple(new FetchExpression(xml);
You can do a sort on the date and return the first record only!
Do your query on accounts then return a for each & use something like:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="activitypointer">
<attribute name="scheduledstart" />
<order attribute="scheduledstart" descending="true" />
<filter type="and">
<condition attribute="scheduledstart" operator="not-null" />
</filter>
</entity>
</fetch>
OR similar Query Expression:
QueryExpression query = new QueryExpression("activitypointer");
query.ColumnSet.AddColumns("scheduledstart");
query.AddOrder("scheduledstart", OrderType.Descending);
EntityCollection results = service.RetrieveMultiple(query);
Then something like:
(DateTime)(((Entity)results.Entities.First()).Attributes["scheduledstart"]);
Add the condition that the regarding field is equal to the account.id that's in scope for the for each loop

Pentaho Data Integration Mapping

I am using Pentaho Data Integration, I created a new transformation and I have 2 steps in it....1 is a CSV file of my data, the second is an Excel file with two columns one is are the state names and the other the sort form of that state name, Example ("New York" "NY")
In my CSV file I have a state columns with the state names "New York" I want to use my excel file to map "New York" with "NY"
I have googled this all day with no clear answer...can anyone help?
You can use Merge Join. Using this you can merge both the files and select the desired columns. Before merging, you have to sort those files according to fields which use are using for mapping. In your case, it will be state name.
I would recommend you to use stream lookup to do this task. Check the test transformation attached. It will do your task.
<?xml version="1.0" encoding="UTF-8"?>
<transformation-steps>
<steps>
<step>
<name>EXCEL</name>
<type>DataGrid</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>State</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
<field>
<name>Short_state</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
</fields>
<data>
<line> <item>New York</item><item>TX</item> </line>
<line> <item>Texas</item><item>TX</item> </line>
</data>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>392</xloc>
<yloc>80</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>CSV</name>
<type>DataGrid</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<name>Full_state_name</name>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
</field>
</fields>
<data>
<line> <item>New York</item> </line>
<line> <item>Texas</item> </line>
</data>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>511</xloc>
<yloc>169</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>Stream lookup</name>
<type>StreamLookup</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<from>EXCEL</from>
<input_sorted>N</input_sorted>
<preserve_memory>Y</preserve_memory>
<sorted_list>N</sorted_list>
<integer_pair>N</integer_pair>
<lookup>
<key>
<name>Full_state_name</name>
<field>State</field>
</key>
<value>
<name>State</name>
<rename>State</rename>
<default/>
<type>String</type>
</value>
<value>
<name>Short_state</name>
<rename>Short_state</rename>
<default/>
<type>String</type>
</value>
</lookup>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>510</xloc>
<yloc>79</yloc>
<draw>Y</draw>
</GUI>
</step>
</steps>
<order>
<hop> <from>EXCEL</from><to>Stream lookup</to><enabled>Y</enabled> </hop>
<hop> <from>CSV</from><to>Stream lookup</to><enabled>Y</enabled> </hop>
</order>
<notepads>
</notepads>
<step_error_handling>
</step_error_handling>
</transformation-steps>

Resources