Problem with image in api on telegram

James BM 7 years ago updated by Supriya Sareddy 6 years ago 8

I have problems with this bot:


It works fine in the simulator, receive an image,sends it to an ocr api, and shows the text response.

But when in telegram the text response is empty. Any specific I need to change for telegram?


Under review

The image object isn't defined in the API node. You will need to define them and store as an object.


What do you mean with "The image object isn't defined in the API node" ? Image is send in the url parameter

The image is uploaded by the user in the step before.

and {imagen} is defined as a image variable

The weird thing is that the API works find in the simulator but fails in telegram.


It will simply not work , you need to :

- Store an image in an image variable 

- Store the image variable in a text variable 

- Extract the file_id ( you can use the myjson.com Api to do that )

- Use the Api telegram to get the file path (Use a url shortener as the variable and api can't handle many text (you can use yourls api)

- Then use the telegram Api (again) to get the direct download link to the image uploaded by users.

After that , you will need to use this telegram direct link (which you need to shorten too)

Instead of {imagen} , use the telegram link. Which is something like https://api.telegram.org/file/bot/<token>/<file_path>

Hope it help

Correct, this is what I was referring to. Let me have a look at it.

Thanks Anthony


Thanks Anthony for helping James with the API.

У меня мой телеграм работает нормально и на телефоне и на компьютере. 
Просто нужно скачивать его с официального сайта и улучшенную версию https://haberkartallari.com/skachat-besplatno-telegram/  и всё будет нормально. А так я вам скажу очень удобный месенджер.