0
Under review
James BM 4 weeks ago in Technical Issues • updated by Praveen Srinivasaiah (Admin) 4 weeks ago 4

I have problems with this bot:

 https://www.onsequel.com/channels/29065/episodes/48331/trees/48322 

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?


Thanks

Under review

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

http://forum.onsequel.com/topics/140-how-do-i-use-an-api-node/

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.