When a bot posts a message via POST /ocs/v2.php/apps/spreed/api/v1/bot/{token}/message,
the response appears to always be DataResponse(null) with HTTP 201.
As far as I can tell, the message is created internally
($comment = $this->chatManager->sendMessage(...) in BotController.php, line ~160),
but the comment data is not serialised into the response.
This means there seems to be no way for the caller to obtain the message_id of the posted
message. Without it, building reply-chains or dialog bindings is not straightforward —
as a workaround, the bot has to scan incoming webhook payloads for its own text.
It would be great if the response included at least { "id": <message_id> }, analogous
to the chat message API.
Relevant code: lib/Controller/BotController.php, line ~184:
return new DataResponse(null, Http::STATUS_CREATED);
Talk version: 23.0.3
When a bot posts a message via
POST /ocs/v2.php/apps/spreed/api/v1/bot/{token}/message,the response appears to always be
DataResponse(null)with HTTP 201.As far as I can tell, the message is created internally
(
$comment = $this->chatManager->sendMessage(...)inBotController.php, line ~160),but the comment data is not serialised into the response.
This means there seems to be no way for the caller to obtain the message_id of the posted
message. Without it, building reply-chains or dialog bindings is not straightforward —
as a workaround, the bot has to scan incoming webhook payloads for its own text.
It would be great if the response included at least
{ "id": <message_id> }, analogousto the chat message API.
Relevant code:
lib/Controller/BotController.php, line ~184:return new DataResponse(null, Http::STATUS_CREATED);Talk version: 23.0.3