Can a bot post an image?

It would help a lot if bots were allowed to post images to the chat like users are. Any REST endpoint available for that?

I just found this very good guide for building chatbots and the article linked here is about attachments:

This is very useful - but to be able to upload a file to a chat group first and then use these links to show the attachment would be much better. So is there an API for uploading files to a chat group?

Hi @Bernd_Gewehr,

We’re working an API for uploading files to a chat group now. Hopefully we can have it ready for release by end of Feb 2019.

1 Like

Any update on the release date? This functionality I am looking to add. My bot integrates with Pagerduty for our Devops team. In incidents there are image urls that would be great to display on the card to have more visual queues on what the alert was from and its state.

1 Like

Hi @A.J,

Apologies for the delayed response.

You can consider referring to this article to send images as attachments to your user.
Please let me know if you have any questions.

I’ve never been able to get that attachments example to work. Posting this:
{
“robot_jid”: "...@xmpp.zoom.us",
“to_jid”: "...@conference.xmpp.zoom.us",
“account_id”: “…”,
“content”: {
“head”: {
“text”: “Message Header”
},
“body”: [{
“type”: “attachments”,
“resource_url”: “https://catalog.openebooks.us/collection/groups/book/USOEI%2FAxis%20360%20ID%2F0016542675”,
“img_url”: “https://d3pqhns20516vc.cloudfront.net/scaled/300/Content%20Cafe/ISBN/9781481446501/cover.jpg”,
“ext”: “pdf”,
“size”: 1000
}]
}
}

returns a response of:
{“message”:null,“code”:500}

Hi @A.J

I was able to replicate your issue. I will be sending these details to our developers, so that they can fix the issue.

Thank you once again for reporting this. I will update this thread as soon as the issue is resolved.

Thanks