We are implementing Mattermost into our Angular app but one of the things we want to provide our users with are webhooks but I do not immediately see this in the api documentation at https://api.mattermost.com/. Is this there or is it coming soon?
Overall working with the API (once the server setup was done) was not overly difficult.
There are actually APIs for adding webhooks, but our documentation is incomplete at this time. It includes most of the commonly used ones, but still doesn’t contain everything used by the web app.
For incoming webhooks, there are a few routes that either require a user on the team or a team admin/system admin depending on if Integrations > Custom Integrations > Restrict managing integrations to Admins is enabled in the System console.
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/incoming/create (POST) which takes a JSON-formatted IncomingWebhook as the body and returns it with its ID field set
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/incoming/delete (POST) which takes a JSON object like {id: ID} as the body and returns its argument
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/incoming/list (GET) which returns a list of all incoming webhooks for that team
For outgoing webhooks, the routes are mostly the same with the same permissions except for an additional route to regenerate an outgoing webhook’s token
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/create (POST) which takes a JSON-formatted OutgoingWebhook as the body and returns it with its ID field set
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/delete (POST) which takes a JSON object like {id: ID} as the body and returns its argument
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/list (GET) which returns a list of all outgoing webhooks for that team
api/v3/teams/{team_id:[A-Za-z0-9]+}/hooks/outgoing/regen_token (POST) which takes a JSON object like {id: ID} as the body and returns the webhook with its updated token field set
The best place to look for every API call is Go client driver or our Javascript client driver as references. You might need to read the code to figure out the exact routes, but they’re usually pretty straightforward