Backendless API respond with image?

Is it possible to build an API endpoint in backendless that responds with an image that can be directly referenced in an image tag?

<img src="backendless.api?input=somevalue" >

I think the image needs to be returned to the call as a blob, but I’m not sure.


Unfortunately, I don’t find a way to use current approach, that might be caused by browser security policies.

What if you make api call to get needed url and just paste it in image src?

Regards, Dima

Hi @Dima,

Is the issue that it’s not possible, or that it’s not possible in Backendless?

I’m trying to set the FB meta tag to an image dynamically. As I understand it, FB doesn’t process JS, which was my first idea. I need another way to dynamically set an image.

<meta property="og:image" content="someimage.jpg" />

So I think it’s related not to Backendless, but to the browser.

These folks seem to be able to do it, right?

A render link directly returns an image (JPEG) the same way a static image is returned from an URL. This means you can use a render link in all places that accept an image from an URL.

You can use a render link in places like the <img> element’s path, meta tags (Twitter card, the Open graph), email, or even a spreadsheet. Also, you can open a render link directly in your browser and download a rendered image manually.

This is exactly what I want to do, but using logic from my Backendless app.

I ask my colleagues, and you were correct. You couldn’t do it in Backendless API Services - because we always return an ‘application/json’ response type.

As for the link which you provided. Yes, you’re right, it’s generally possible, but we can’t provide you examples/advices on how to do it easily.

Thanks for investigating for me @Dima. I really hoped you would be able to help.