summaryrefslogtreecommitdiffstats
path: root/appinfo
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-07-26 18:38:09 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-07 11:35:25 +0200
commit4ee530a1901f81233c38c6c8881bf0feefe8a33a (patch)
tree3057d82e4ca91a2c0a5af602f0817835dcc00f7f /appinfo
parent0eebe05ab0613ef62192ed3c8fcd7eca939db0fb (diff)
feat(bots): Add API to list, enable and disable bots in a conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/routes/routesBotController.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/appinfo/routes/routesBotController.php b/appinfo/routes/routesBotController.php
index c8a1d5db1..f61d6aa1f 100644
--- a/appinfo/routes/routesBotController.php
+++ b/appinfo/routes/routesBotController.php
@@ -28,9 +28,21 @@ $requirements = [
'token' => '[a-z0-9]{4,30}',
];
+$requirementsWithBotId = [
+ 'apiVersion' => 'v1',
+ 'token' => '[a-z0-9]{4,30}',
+ 'botId' => '[0-9]+',
+];
+
return [
'ocs' => [
/** @see \OCA\Talk\Controller\BotController::sendMessage() */
['name' => 'Bot#sendMessage', 'url' => '/api/{apiVersion}/bot/{token}/message', 'verb' => 'POST', 'requirements' => $requirements],
+ /** @see \OCA\Talk\Controller\BotController::listBots() */
+ ['name' => 'Bot#listBots', 'url' => '/api/{apiVersion}/bot/{token}', 'verb' => 'GET', 'requirements' => $requirements],
+ /** @see \OCA\Talk\Controller\BotController::enableBot() */
+ ['name' => 'Bot#enableBot', 'url' => '/api/{apiVersion}/bot/{token}/{botId}', 'verb' => 'POST', 'requirements' => $requirementsWithBotId],
+ /** @see \OCA\Talk\Controller\BotController::disableBot() */
+ ['name' => 'Bot#disableBot', 'url' => '/api/{apiVersion}/bot/{token}/{botId}', 'verb' => 'DELETE', 'requirements' => $requirementsWithBotId],
],
];