From 878e35c336bcb8572c1e7173337b7c0109e708b7 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento <rodrigoknascimento@gmail.com> Date: Fri, 8 Jan 2016 21:55:31 -0200 Subject: [PATCH] Add api `chat.messageExample` --- packages/rocketchat-api/server/routes.coffee | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/rocketchat-api/server/routes.coffee b/packages/rocketchat-api/server/routes.coffee index ac4f99d1e62..b7cafb17220 100644 --- a/packages/rocketchat-api/server/routes.coffee +++ b/packages/rocketchat-api/server/routes.coffee @@ -17,6 +17,40 @@ RocketChat.API.v1.addRoute 'me', authRequired: true, ] +# Send Channel Message +RocketChat.API.v1.addRoute 'chat.messageExamples', authRequired: true, + get: -> + return RocketChat.API.v1.success + body: [ + token: Random.id(24) + channel_id: Random.id() + channel_name: 'general' + timestamp: new Date + user_id: Random.id() + user_name: 'rocket.cat' + text: 'Sample text 1' + trigger_word: 'Sample' + , + token: Random.id(24) + channel_id: Random.id() + channel_name: 'general' + timestamp: new Date + user_id: Random.id() + user_name: 'rocket.cat' + text: 'Sample text 2' + trigger_word: 'Sample' + , + token: Random.id(24) + channel_id: Random.id() + channel_name: 'general' + timestamp: new Date + user_id: Random.id() + user_name: 'rocket.cat' + text: 'Sample text 3' + trigger_word: 'Sample' + ] + + # Send Channel Message RocketChat.API.v1.addRoute 'chat.postMessage', authRequired: true, post: -> -- GitLab