Skip to content

Bot API message endpoint does not return message_id #17773

Description

@tkaufmann

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions