-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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] Add new API endpoints #8947
Conversation
6e8e784
to
677b9fc
Compare
@@ -0,0 +1,24 @@ | |||
RocketChat.API.v1.addRoute('subscriptions.get', { authRequired: true }, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be to hard to have the same response format for calls with and without the updatedAt filter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, not at all...aka check now. ;)
…oken, and fix the structure of the rooms/subscriptions.get results
check(rid, String); | ||
check(limit, Match.Optional(Number)); | ||
|
||
// TODO: Evaluate why we are returning `users` and `channels`, as the only thing that gets set is the `messages`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone answer this question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we shouldn't be... This looks kinda like maybe duplicated from spotlight? As that's the only thing I can think of that returns all 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@graywolf336 It probably was a copy of what slack does at that time:
I don't know if that is what we want now, need to discuss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this essentially what the spotlight methods do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geekgonecrazy Yes, but it was prior to the spotlight implementation
@sampaiodiego Good finding! 👍 |
@rodrigok are we just waiting on someone to review this pull request to merge it? |
@rodrigok Can you add the APIs to list reactions and to react to some message in another PR? |
@graywolf336 Yes, @sampaiodiego will do the review, but it would be helpful if you do the review too. @rafaelks What? |
|
@rafaelks I don't think I understand why you are asking this here, but yes, everything else will be added in another PR 😄 just keep that document listing the APIs mobile needs updated |
@rodrigok I know this was intentional, but this is a huge breaking change - authentication tokens now expire. So, we will need to alert everyone to this as it is a MAJOR breaking change with how our REST API is consumed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good..
agreed to @graywolf336 the change on expiring API tokens should be listed as a breaking change on release notes (at least).
@graywolf336 @sampaiodiego I fixed it and it's keeping the old behavior. Thanks @graywolf336 |
I'm receiving this field (along with the expected message and success fields) from the sendMessage API: "developerWarning" : "[WARNING]: The \"usernames\" field has been removed for performance reasons. Please use the \"*.members\" endpoint to get a list of members\/users in a room."
Seems weird to me, but otherwise it's working. |
@cardoso it's just a warning and can be ignored. Not everyone follows along with the development, so we are letting them know that |
@graywolf336 looks like it's happening in other api calls https://unstable.rocket.chat/api/v1/service.configurations Maybe all? That's pretty bad for network usage on mobile. |
@cardoso feel free to open an issue about it so that someone can work on improving it. 👍 |
Closes #8002, #8864, #8891
sendMessage
Meteor method (allow passing_id
)Will be implemented later via DDP and will be available automatically to REST
GET v1/rooms.get
updatedSince
-> Date as ISO stringGet all of the rooms
Get the rooms which have changed after the provided date
Both of these have the same result structure, however when you provide the
updatedSince
query parameter then theupdate
will contain only those updated andremove
will contain those which have been removed.GET v1/subscriptions.get
updatedSince
-> Date as ISO stringGet all subscriptions
Get subscriptions changed after a date
Both of these have the same result structure, however when you provide the
updatedSince
query parameter then theupdate
will contain only those updated andremove
will contain those which have been removed.POST v1/login
When 2FA is required and not passed
curl http://localhost:3000/api/v1/login -d "username=bob&password=pass"
Passing 2FA (code)
curl http://localhost:3000/api/v1/login -d "username=bob&password=pass&code=123456"
DDP compatible (now it's possible to use the same data passed to DDP)
GET v1/service.configurations
curl http://localhost:3000/api/v1/service.configurations"
POST v1/push.token
apn
orgcm
DELETE v1/push.token
POST v1/rooms.upload/:_id