Cannot connect to Mattermost api v4


Yesterday we installed the Mattermost from Bitnami launchpad for Azure.

The website works fine, however I tried the whole day to connect to the api using postman without luck.

I create a bot account with a access token and there is no way to get a successful connection the the api.

One think that we noticed is that when we try connect via ssh with the following command:

curl localhost:8065

We get a html error saying that “Cannot connect to Mattermost”.

But when I browse the Mattermost website from a browser is working fine. The problem is that we cannot access the api.

We tried different endpoints like the login and teams without luck.

Any idea what we are missing ?



Hello, @dsapo

Since you mentioned that you were able to access Mattermost through the web browser, I would like to understand a little better the address you used to access it. Were you accessing it through http://localhost:8065 itself or rather

Were you trying to run the curl command from the same machine that you deployed Mattermost on? Can you also provide some screen shots on how you try to utilize the API on Postman?

Lastly, I would like to know if you are able to use a simple cURL command to send a message to a room via terminal in the machine you deployed Mattermost on:

curl --location --request POST "http://localhost:8066/api/v4/posts" --header "Authorization: Bearer <token>" --header "Content-Type: application/json" --header "X-Requested-With: XMLHttpRequest" --data "{\"message\":\"This is a new test\", \"channel_id\":\"<channel_id>\"}"


The issue is solved by removing the port number in the api route.

Based on the documentation I thought that the port number 8065 was necessary, but it was not, so once we took it out, we were able to access the api using postman.



1 Like

Hello, @dsapo

Wonderful! Happy to know that the issue is solved on your end. :+1: