From 69cac604e09c139845d2f63ac95fb702fb5a9fe1 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 21 Feb 2017 19:42:34 -0500 Subject: Implement create and get incoming webhook endpoints for APIv4 (#5407) * Implement POST /hooks/incoming endpoint for APIv4 * Implement GET /hooks/incoming endpoint for APIv4 * Updates per feedback --- api4/api.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'api4/api.go') diff --git a/api4/api.go b/api4/api.go index df45ff1a3..ca43e7275 100644 --- a/api4/api.go +++ b/api4/api.go @@ -52,11 +52,11 @@ type Routes struct { Command *mux.Router // 'api/v4/commands/{command_id:[A-Za-z0-9]+}' CommandsForTeam *mux.Router // 'api/v4/teams/{team_id:[A-Za-z0-9]+}/commands' - Hooks *mux.Router // 'api/v4/teams/hooks' - IncomingHooks *mux.Router // 'api/v4/teams/hooks/incoming' - IncomingHook *mux.Router // 'api/v4/teams/hooks/incoming/{hook_id:[A-Za-z0-9]+}' - OutgoingHooks *mux.Router // 'api/v4/teams/hooks/outgoing' - OutgoingHook *mux.Router // 'api/v4/teams/hooks/outgoing/{hook_id:[A-Za-z0-9]+}' + Hooks *mux.Router // 'api/v4/hooks' + IncomingHooks *mux.Router // 'api/v4/hooks/incoming' + IncomingHook *mux.Router // 'api/v4/hooks/incoming/{hook_id:[A-Za-z0-9]+}' + OutgoingHooks *mux.Router // 'api/v4/hooks/outgoing' + OutgoingHook *mux.Router // 'api/v4/hooks/outgoing/{hook_id:[A-Za-z0-9]+}' OAuth *mux.Router // 'api/v4/oauth' @@ -145,6 +145,7 @@ func InitApi(full bool) { InitPost() InitFile() InitSystem() + InitWebhook() app.Srv.Router.Handle("/api/v4/{anything:.*}", http.HandlerFunc(Handle404)) -- cgit v1.2.3-1-g7c22