scratch-api-unofficial-docs
scratch-api-unofficial-docs copied to clipboard
Add /users/<user>/messages
- [x] /users/<user>/messages (requires auth)
- [ ] /users/<user>/messages/admin (requires auth)
- [x] /users/<user>/messages/count
- [ ] Bonus: /users/<user>/invites (requires auth)
invite object: datetime_created, id. Can be dismissed like normal admin messages probably.
See LLK/scratch-www#1487 for a PR that uses these.
/users/<user>/messages/admin is probably used for private notifications from administrators; I can document it, but I can't seem to get any results (it just returns an empty array, regardless of the number of alerts the account has). Maybe it's a totally new feature? (If so, I wonder what'll happen to old alerts. Probably I'm just testing it wrong.)
Old alerts are all gone/hidden, and not returned from the API.
@towerofnix Your "Authorisation" page says that the auth token is for the Scratch site; not the API -- but your example demonstrates the opposite
@joker314 I'd appreciate you opening another issue for that rather than commenting here. It seems not relevant to this issue, but maybe I'm misunderstanding?
In any case, I'm not sure I see what you mean?
Some API endpoints require you to authenticate that you are a specific person... This token can be gotten from the URL https://scratch.mit.edu/session/ (note this is on scratch.mit.edu, not the API site)... for example
https://api.scratch.mit.edu/users/<username>/messages?x-token=<token>
.
These are all true (API endpoints are the ones that require you to authenticate; the token is gotten from scratch.mit.edu; that example URL works).
Oh I see, I misunderstood. Never mind
I got a Scratcher invite on a test account.
<- https://api.scratch.mit.edu/users/<username>/invites
-> {"id":(invite id),"datetime_created":"(datetime)","unread":1,"actor_id":(actor id),"invitee_id":(invitee id)}
Invitee ID is 17629253, dunno what that means though.
"Unread" stayed at 1, even after clicking "Click here to learn more!".
Btw, request to become a Scratcher is GET https://scratch.mit.edu/users/complain-about/promote-to-scratcher/
, apparently.
After becoming a Scratcher, /invites
changed to {}
(same way it was before I had the invite).
Btw, request to become a Scratcher is
GET https://scratch.mit.edu/users/complain-about/promote-to-scratcher/
, apparently.
Can you clarify what this means? thanks!