Is it possible to create a poll in a channel via Rest API?

Summary
If i use the Rest API /api/v4/posts to create poll with the help of slash command ‘/poll’ it posts only the message “/poll “Poll text”” instead of creating the poll.

Steps to reproduce
Use the POST rest api ‘/api/v4/posts’ with following json body.

{
“channel_id”: “<valid_channel_id>”,
“message”: “/poll "Creates no poll"”
}

Expected behavior
The api call creates a Poll with the message “Creates no poll”.

Observed behavior
The api call posts only the message “/poll “Creates no poll”” instead.

Hi Matze, thanks for reaching out! While the REST API itself doesn’t directly create polls, you can use the /poll slash command from within Mattermost’s “Matterpoll” integration to create polls interactively. Let us know if you have additional questions! :blush:

Hey John, thanks for your reply. So it is not possible to automate the creation of a poll over an api call? The only way to create a poll is interactively with the help of the slash command ‘/poll’?

You could also ask in Mattermost

1 Like

I’ll try. Thanks for your reply.

You could also open a Github issue Issues · mattermost/mattermost · GitHub

1 Like