From 65893d2c4afa6d838d2dc438c7c413d473c0d9ab Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 26 Jul 2023 18:38:09 +0200 Subject: feat(bots): Add API to list, enable and disable bots in a conversation Signed-off-by: Joas Schilling --- appinfo/routes/routesBotController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'appinfo/routes/routesBotController.php') 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], ], ]; -- cgit v1.2.3