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

Add /users/<user>/messages #18

Open
2 of 4 tasks
towerofnix opened this issue Aug 30, 2017 · 8 comments
Open
2 of 4 tasks

Add /users/<user>/messages #18

towerofnix opened this issue Aug 30, 2017 · 8 comments
Labels

Comments

@towerofnix
Copy link
Owner

towerofnix commented Aug 30, 2017

  • /users/<user>/messages (requires auth)
  • /users/<user>/messages/admin (requires auth)
  • /users/<user>/messages/count
  • Bonus: /users/<user>/invites (requires auth)

invite object: datetime_created, id. Can be dismissed like normal admin messages probably.

@towerofnix towerofnix added the api label Aug 30, 2017
@towerofnix
Copy link
Owner Author

towerofnix commented Aug 30, 2017

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

@towerofnix
Copy link
Owner Author

towerofnix commented Aug 30, 2017

/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
Copy link
Owner Author

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

@joker314
Copy link
Contributor

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

@towerofnix
Copy link
Owner Author

towerofnix commented Feb 13, 2018

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

@joker314
Copy link
Contributor

Oh I see, I misunderstood. Never mind

@towerofnix
Copy link
Owner Author

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

@RedGuy12
Copy link

RedGuy12 commented Jan 5, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants