We're Hiring!

Mattermost, Inc.

Triggering slash command using API

I am developing a plugin that will utilize a slash command, and have some front end components that I want to allow to call that slash command. However, whenever I send a request to the API as shown here, I am given the response containing:

{
    body: (...)
    bodyUsed: false
    headers: Headers {}
    ok: false
    redirected: false
    status: 405
    statusText: "Method Not Allowed"
    type: "basic"
    url: "http://localhost:8065/commands/execute"
}

I’m wondering why it is responding with a 405 status, and what I might do to fix it so that I can trigger the slash command that I have working.

The first step you’ll wanna take here is checking the console, which should give you some more information on what went wrong. On the menu that comes out from the top left, go System Console > Server Logs, and see what went wrong.
Are you doing a POST request with the proper authorization bearer?