Mattermost, Inc.

[SOLVED] API to modify messages?

Hi,

I was starting to work on a bot to have polls (a la Slack Simple Polls). This requires a message with special links that will modify the message itself (increasing the votes for example).
Is there an API to update a specific message in a channel? Can’t really find any info in the documentation.

Thanks

Hi @ngcnelson, my guess is that this would be done using the “Update a post”, is that the documentation you were looking for?

Yes! Excellent! Thanks for the fast reply @lfbrock

OK…so unfortunately, it seems like I’m not going to be able to do what I want.
I wanted to create a slash command that posts a “poll” message, where each option being polled is a link, people can click on the link that will call the API to update the same message with the counters (similar to how here in the forum there is a counter of how many people have clicked a link).
However, in order to update the message (via API provided) the user needs to be authenticated with a bearer token, and this is not possible with a simple link.
Therefore is not possible to make it as a simple click to vote.
I guess the only option to this is the current ticket for “Liking” posts…then the poll can generate posts and the users can like them as a way of voting.