diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-02-21 19:42:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 19:42:34 -0500 |
commit | 69cac604e09c139845d2f63ac95fb702fb5a9fe1 (patch) | |
tree | 611920333a5d55f5db0cca43bd3cb5cf1bee30e8 /api4/api.go | |
parent | b61115df55ea6eba9976e561a8b39bf5a297fcc9 (diff) | |
download | chat-69cac604e09c139845d2f63ac95fb702fb5a9fe1.tar.gz chat-69cac604e09c139845d2f63ac95fb702fb5a9fe1.tar.bz2 chat-69cac604e09c139845d2f63ac95fb702fb5a9fe1.zip |
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
Diffstat (limited to 'api4/api.go')
-rw-r--r-- | api4/api.go | 11 |
1 files changed, 6 insertions, 5 deletions
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)) |