botframework get attachment api returns with 404 for old images - botframework

Background
We are using the following api to fetch image data uploaded from our user via bot.
The API reference is the following.
https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#get-attachment
And the use case is the following.
User pasted image along with text and send message to bot.
The following image is the [bot side].
We are fetch the pasted image data and show it on [our app side].
The following is our app side.
Issue
But we found that for the images uploaded [1 month ago], the API returns with 404 http code and we could not get image data anymore.
For the images uploaded recently, The api responsed with 200 and image binary data which we can take usage and show it.
Question
Is it possible that MS side put some restriction for pasted image that uploaded to botframework blob storage more than a month?

It's important to note that the Azure Bot Service's Connector service is not a storage service. When attachments are sent to/thru the Connector, Azure will store the attachment for no more than 24 hours.
If you are needing to access attachments sent days/weeks/months ago, then you should utilize Azure Blob Storage, or some equivalent service, to meet those needs.

Related

Is there any way for Amazon lex to print/render image on a php website? (webhost000)

Im using amazon lambda for the backend for the chatbot and I have no idea how to let the chatbot generate the image from my website. I read about custom payload but the documentation is very sparse and lack in information. I tried to send it with html tags in the content and in json format but both did not work. Dialogflow for example has very straightforward documentation in generating the image but somehow amazon lex makes it hard for me.
Please have a look at this answer on a similar question: https://stackoverflow.com/a/69633494/8880593
Perhaps consider storing the images in an S3 bucket then returning the image link using the ResponseCard or GenericAttachment feature.
You could secure the image through the use of presigned URL's. Storage capacity on S3 can be managed through the implementation of a lifecycle policy to automatically delete these images after a specified period of time.
S3 - Sharing an object with a presigned URL
S3 - Expiring Objects

Is it possible to serve images from Firebase static hosting?

I have a simple Firebase web application which is hosted on Firebase static hosting service where you can upload a picture with some textboxes and it gets stored in the Firebase realtime database like this:
{
name: string,
description: string,
picData: base64 string
}
Now I would like to serve this image via a HTTP Get request. Is that even possible?
Something like: http://myawesomewebsite.com/getImage?name=x
The same like https://picsum.photos/ does it.
To be able to serve content from the Firebase Realtime Database on a GET request, you will have to extend the functionality of Firebase Hosting using Cloud Functions for Firebase or Cloud Run.
The Connect Functions to Hosting section explains the steps required to serve a "bigben" page that could quickly be adapted to decode the base64 in your database and return the data. Be wary that you must also specify the image's mime type (e.g. image/png, image/jpeg) when serving the image which you don't currently store in your database.
While possible, I would recommend storing your images in Firebase Storage instead. This will help keep track of meta data such as sizes, mime types and upload times whilst not clogging your database with files stored in Base64. Images stored on Firebase storage can also be retrieved via a GET request by the client SDKs or served from a Cloud Function.

How to get image from SharePoint document library into thumbnail card of messaging extension of bot framework

I'm having a SharePoint document library which contains some icons. And i'm having a azure web app bot used for messaging extension using bot framework. In messaging extension preview thumbnail card i need to load the icons from SharePoint library.
Both SharePoint document library and Azure bot are on different tenant and users are also different.
SO when i'm trying to load icons from SharePoint library its giving me unauthorized error due to different tenant and users.
Is there any way to pass base64 string to thumbnail card in to load the image instead of url.
I have tried to convert image from SharePoint document library to base64 string but didn't got a way to pass that base64 string to messaging extension.
I need to show images from sharepoint document library into thumbnail card of bot framework.
There are 2 approaches you can implement.
Store images to Azure blob storage and use static url from the blob. You can use SAS key for security.
Other approach is storing images to SharePoint doc library as you listed in question then you are getting base64 value of image and store that value to a variable and use it in DataUri as below
string.Format("data:image/png;base64,{0}",Convert.ToBase64String(photoBytes));

Youtube reporting API returns 403 for content owner reports

I am trying to download content owner reports via the Youtube Reporting API. When I try to list reports by content owner (onBehalfOfContentOwner) I get a 403 "The caller does not have permission". When I leave out the content owner parameter I only get channel reports back.
I have tried using OAuth2 tokens generated for both a manager of the channel and the channel user itself (generated using the server-side flow:). This happens from both the client library and the API explorer.
What could be going wrong here? Perhaps the issue has to do with the way the accounts are set up in Google Cloud - the channel manager has been added to the Google Cloud project, and the Youtube Reporting and Youtube Analytics have been enabled for that project.

How to upload an image with metadata like Description and title

I'm currently writing an WebApi endpoint that is to accept image uploads with associated Descriptions and titles. I want to be able to send this information up in one post rather than sending the image and then the meta data in a subsequent call.
The client sending this is a mobile application written in Xamarin.
Searching the internet I struggled to fine any direction to doing this kind of thing although I'm sure it's possible.
Any help or pointers would be appreciated.
USE CLOUDINARY
upload image to cloud with easy api like
https://res.cloudinary.com/demo/image/upload/w_150,h_150,c_thumb,g_face,r_20,e_sepia/l_cloudinary_icon,,x_5,y_5,w_50,o_60,e_brightness:200/a_10/front_face.png
The DotNet SDK is here
and a tutorial to add metadata along

Resources