In Outlook REST API how can I set BodyType to Text - outlook-restapi

I EWS, I was able to specify BodyType = 'Text' when querying email messages. Is there any alternative to this in Outlook REST api?
I tried to use PidTagBody property which is a plain text representation of message body, but it just seems to be empty for all messages with Html body type.
Thanks.

Related

Azure Logic app read my approval email in form of HTML tags

I have created a Azure Logic app to read the email body and check for the condition - If the email body 1st line has the only word called "Approved", then trigger another process or else do nothing.
But when performing it, I could see the condition gets to false even though the mail has only Approved word in it accommodated with signatures in the bottom. After researching, I could see the email is being read like HTML tags. So i created two more variable to extract a part of this e-mail and check for condition.
EmailBodyTrimmed = trim(substring(toUpper(replace(replace(trim(variables('EmailBody')),' ',''),'.',''),),0,500))
EmailBodyTrimmedFinal = trim(substring(trim(replace(trim(variables('EmailBodyTrimmed')),' ','')),0,indexOf(replace(variables('EmailBodyTrimmed'),' ',''),'<')))
But nothing seems to give correct answer. Can anyone help me ?
I think you can use Body Preview to receive the body of the email:
According to my test results, it receives the text in non-HTML format, so you don't have to extract the body from the HTML text.
Then you only need to add a condition and use starts with to determine whether it starts with approved.
Of course, this premise is that your email body is in plain text format, if it is in excel format, you need to do other processing.

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.

How to detect the format of the email being composed in an Outlook Add-in?

I saw that Office.context.mailbox.item.body.setSelectedDataAsync() would fail if called with options.coercionType set to Office.CoercionType.Html when the message body is in plain text.
I was wondering if there was any way to check what the format of the message body is before I called setSelectedDataAsync?
You would need to use getTypeAsync method of the body object. Even more, this is suggested way to insert any data into the mail item's body. Before inserting, you should always first verify the supported item format by calling getTypeAsync. Please read more on the topic how to Insert data in the body when composing an appointment or message in Outlook in the Outlook API documentation.

How can I get what the recipient wrote in all the fields of a document?

I have been able to retrieve an image of the recipient's signature, but my documents have a lot of text fields and I would like to get what the recipients entered in each of them.
Use the ListEnvelopeRecipients api with the include_tabs=true query string parameter.
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients?include_tabs=true

Set recipient in Composite Template

I use Foxit Phantom for pre-fill tabs to documents. I use PDF form with label DocuSignSignHere. But, How to set recipient using this technique?
https://www.docusign.com/p/APIGuide/Content/Sending%20Group/Rules%20for%20CompositeTemplate%20Usage.htm
I tried to set number after label: DocuSignSignHere 1, DocuSignSignHere 2. It does not work. Is it possible? How to set recipientID with PDF Form?
You can not set DocuSign recipient information through the PDF fields of the document you want to get signed. Instead you need to set that information in the API call you make to DocuSign, inside the JSON properties of your request body.
Here is a full code sample (in 6 languages) of how to request a signature on a local document:
http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromDocument
And make sure you check out the other 8 API Walkthroughs here.
In our way solution was in using Automatic Anchor Text with Custom Tags

Resources