How to fetch a specific inline image using OWA REST API? - outlook-restapi

I'm developing OWA add-in using OWA REST API
When fetching the message item, I can see in the body if there's an inline image added which is looks like
<p style="margin-top:0; margin-bottom:0">
<img class="EmojiInsert" src="cid:773570bf-3178-41a4-97ac-4e3eddef859f" style="">
<br>
</p>
in the src I can see the contentId of the attachment but the resource reference did not says if this property is searchable or filterable, and I cant $select it in the odata query params, therefore I cant get that attachment!
the alternative way was to fetch the list of the attachments by doing:
https://outlook.office.com/api/v2.0/me/messages/{id}/attachments
but that will:
1- fetch all attachments with their contentBytes which is too expensive!
2- if the admin increase the minimum upload to be more than 35MB I might got error with that request i single attachment >35MB, see this question that no one answer it yet
3- I alway got some attachments that I did not upload, sometime from outlook it self (VERY WIERD) other time if I upload an attachment(s) and remove it I still get it when fetching the attachments, so some time I have for example 3 attachments but I got 12!!
Is there a way to know the inline image attachment id? and then get that attachment?

Related

Docusign - api get utl to download document

I need api to create URL link for download document of envelope.
I found this api:
GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
But this api just return the file and i what a URL i can download the file (of course with expired time)
The endpoint you're looking for is:
POST /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient
You will need to provide in the body information about the recipient, see here for details:
https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient
We also have code examples in various langagues to show you how to do this here:
https://developers.docusign.com/esign-rest-api/code-examples/code-example-request-a-signature-via-email

DocuSign - Random UNABLE_TO_CONVERT_DOCUMENT error

I am using Docusign create envelop API using the endpoint https://au.docusign.net/restapi/v2/accounts/{AccountID}/envelopes. The API call works on most instance but occasionally I am receiving an error stating that the System was unable to convert this document to a PDF. I am submitting a docx type document which is failing randomly(say once in a day). On re submission the same document submission works without any issue.
In order to understand the problem I tried enabling logging on DocuSign login. Since the log can only keep upto 50 entries at any given time I am clearing the log to ensure I am ready to capture the failure when it happens.
Actual Error Message received:
{
"errorCode": "UNABLE_TO_CONVERT_DOCUMENT",
"message": "System was unable to convert this document to a PDF. Unable to convert Document(Document Name.docx) to a PDF. Error: UserId:{GUID} IPAddress:XX.XX.XXX.XXX Source:ApiRESTv2:Failed to convert FileType: docx"
}
Now I am trying to download the log file via DocuSign UI and I am receiving constant timeout issue while trying to do so. Does anyone know about any programmatic log file extract from DocuSign? Anyone done this previously?
Any pointers on the error resolution or help downloading the error log is much appreciated. Please help
The DocuSign platform by default accepts PDF documents so when sending through the API you simply need to include the document bytes for PDFs. However for any other file format you need to set the fileExtension property on the document object to the file type you are sending.
For example if using one of the open source DocuSign SDKs use the setFileExtension() setter method to set the extension:
document.setFileExtension("docx");
Or if you are calling the REST API directly (ie not using an SDK) then set the fileExtension property to "docx":
{
...
"fileExtension": "docx",
....
}
If you still receive the error after this then you I would start testing with a different document and confirm the document you are using not corrupt in any way and if properly formatted.

How to retrieve all images from multiple photo post on Instagram

Recently Instagram announced support for multiple photos post.
I tried with endpoint, GET /media/media-id, but response has information about only one image.
Anyone is able to retrieve all images from single multiple photo post using their API?
Thanks.
Not available in official API yet, but you can use the "Instagram Photo Page URL" and add ?__a=1, this will give you JSON with all the multi-images in it.
For example:
https://www.instagram.com/p/BQ00n_BB7Dm/?__a=1
You will get JSON response with media.edge_sidecar_to_children.edges[] will have all media urls and info
Instagram API now supports the "multi photo" posts.
If a post is of type "multi photo", in the API the "type" property will now be with the value "carousel" and the "mediaData" property will contain "carousel_media" property with an array of the images (posts).

Which AMP extensions can fetch a response from an endpoint?

What AMP extensions can be used to get a response from the server in the form of variable that can be used later, such as in a template or as a parameter to an attribute?
amp-access
The authorization endpoint of amp-access can return "a free-form JSON object":
Here’s a small list of possible ideas for properties that can be returned from the Authorization endpoint:
Metering info: maximum allowed number of views and current number of views.
Whether the Reader is logged in or a subscriber.
A more detailed type of the subscription: basic, premium
Geo: country, region, custom publication region
amp-form
amp-form "allows publishers to render the responses using Extended Templates". The response is expected to be a valid JSON Object. Try the "Hiding input fields after success" demo in the amp-form sample to see it in action.
amp-list
amp-list fetches "content dynamically from a CORS JSON endpoint and renders it using a supplied template". The response must be a JSON object that contains an array property "items".
In addition to {{variable}} substitutions in Mustache templates, you can also use AUTHDATA(variable) elsewhere.
amp-live-list (not quite)
amp-live-list is a "wrapper and minimal UI for content that updates live in the client instance as new content is available in the source document". The page will re-fetch itself, giving the server a change to send new content. If new content is found, AMP will populate a <div items> element with the new (HTML) items. You can't use that as a variable.
It's name doesn't really suggest it, but I think you want AMP-list
https://github.com/ampproject/amphtml/blob/master/extensions/amp-list/amp-list.md
Fetches content dynamically from a CORS JSON endpoint and renders it using a supplied template.

sending html content in email body(emailBlurb) docusign api

I am trying to send html content in my emailBlurb for sending email for document signature by using the following code portion :
DocumentSignatureRequest documentSignRequest = new documentSignatureRequest();
String blurb = "Testing html email content : <b>Bold content</b>";
documentSignRequest.setEmailBlurb(blurb);
But the emails I receive from this contain the whole string, instead of using the with the <b> instead of bold text. So, I looked at the docs provided by docusign and it indicated for looking at the 'email resource file' in the docusign account. In the file i found the portion :
<td class="MainStyle" colspan="2">
<p>[[EmailBlurb]]</p>
<p>[[RecipientNote]]</p>
</td>
I am guessing the 'emailBlurb' I am setting is being used simply as a string and thus the html tags are just being displayed as is.
So my question, what are my options with finding a way around this. I know an option is to edit the resource file, but are there any other better options. For instance, any settings or tags in the resource file around the [[EmailBlurb]] or if it can be done from my code? Please help.
It's possible to insert raw html into the notification emails however this is not a self-service option. You need to reach out to your DocuSign Account Manager or their Support to have the option enabled in your account.

Resources