Good afternoon, my team and I have an application created by us and we need that every time the application finds a vulnerability sends a message to a specific channel.
We have the channel created and its corresponding incoming Webhook.
I have created a personal token and I have managed to authenticate with this in the url of our mattermost.
But now I want to send a text message via curl to the channel and I get the following failure.
To authenticate I have used the following command lines in windows 10 cmd with success:
curl -i -d “{“login_id”:"myId”,"password":"myPassword"}" serverUrlMattermost:port/api/v4/users/login
curl -i -H "Authorization: Bearer myPersonalToken http://serverUrlMattermost:port/api/v4/users/me
But I have tried to send a message to the channel with the following command lines without success:
curl.exe -H “Content-Type:application/json” -d “{‘text’:‘Hello World’}” serverUrlMattermost:port/hooks/1us8g6zri7noxm7j7xunrcrn1w
curl -H ‘Content-Type: application/json’ -d ‘{“text”: "{‘text’:‘Hello World’}’ serverUrlMattermost:port/hooks/1us8g6zri7noxm7j7xunrcrn1w
curl -i -X POST -H ‘Content-Type: application/json’ -d “{“text”:Hello, this is some text. }” serverUrlMattermost:port/hooks/1us8g6zri7noxm7j7xunrcrn1w
I don’t know what to do anymore, please if someone can help me I would appreciate it. Thank you very much!