scratch-api-unofficial-docs icon indicating copy to clipboard operation
scratch-api-unofficial-docs copied to clipboard

Add /users/<user>/messages

Open towerofnix opened this issue 7 years ago • 8 comments

  • [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.

towerofnix avatar Aug 30 '17 12:08 towerofnix

See LLK/scratch-www#1487 for a PR that uses these.

towerofnix avatar Aug 30 '17 12:08 towerofnix

/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.)

towerofnix avatar Aug 30 '17 15:08 towerofnix

Old alerts are all gone/hidden, and not returned from the API.

towerofnix avatar Sep 10 '17 14:09 towerofnix

@towerofnix Your "Authorisation" page says that the auth token is for the Scratch site; not the API -- but your example demonstrates the opposite

joker314 avatar Feb 13 '18 19:02 joker314

@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).

towerofnix avatar Feb 13 '18 19:02 towerofnix

Oh I see, I misunderstood. Never mind

joker314 avatar Feb 13 '18 20:02 joker314

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).

towerofnix avatar Jul 31 '18 01:07 towerofnix

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!

cobaltt7 avatar Jan 05 '21 22:01 cobaltt7