Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Send message with REST API #8864

Closed
cardoso opened this issue Nov 14, 2017 · 4 comments
Closed

[NEW] Send message with REST API #8864

cardoso opened this issue Nov 14, 2017 · 4 comments
Assignees
Milestone

Comments

@cardoso
Copy link
Contributor

cardoso commented Nov 14, 2017

Description:

We currently have a chat.postMessage API:
https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage (outdated)

But that doesn't allow us to specify an id for the message like the Real-Time API:

{
    "msg": "method",
    "method": "sendMessage",
    "id": "42",
    "params": [
        {
            "_id": "message-id", // << specify id
            "rid": "room-id",
            "msg": "Hello World!"
        }
    ]
}

We need something similar, but REST.

Either a new one (chat.sendMessage) mimicking the Real-Time API,
or adding _id in the existing chat.postMessage

@rafaelks
Copy link
Contributor

@graywolf336 This one needs a little priority for the mobile apps.

@graywolf336
Copy link
Contributor

Idea: change the current endpoint to accept a query that switches the internal logic to use the Meteor method of sendMessage. The reason we can't change the current logic is because it allows sending the same message to multiple channels thus resulting in more than one message object which is also the reason we can't allow the _id to be provided since then it wouldn't be unique on that index.

@rafaelks
Copy link
Contributor

@graywolf336 I think a new API will be more simple to maintain and to write the docs.

@graywolf336
Copy link
Contributor

Will be added with #8947

@rodrigok rodrigok closed this as completed Dec 6, 2017
@rodrigok rodrigok added this to the 0.60.0 milestone Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants