-
Notifications
You must be signed in to change notification settings - Fork 13
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 studio (view/modify) API #28
Comments
By the way, it's not My theory was that endpoints that are sent an authentication token will return extra data for the Scratch Team. I find this not as likely anymore, though -- so it might be that the implementation in the linked issue is wrong. (Or a bug in the API!). Either way, devs might want to know. |
My guess is that you need authentication to join a studio, but not to view your (or anyone's) studio list. So either the PR writer (@benjiwheeler, pinging you) or internal documentation for scratch-api made a mistake and thought authentication was needed either way. Anyways, it makes sense that you can view a list of which studios a user is curating without being authenticated; that's one of the rows on any profile page ("Studios I Curate"). |
There exists a risk that ST employees are instructed not to interact with repositories of others (especially of kids), it might be a good idea to track this in the pull request rather than here -- especially since all the ST devs will be watching? |
Oh, good point. I just didn't want to look like I was intruding on the discussion of a PR I'm unrelated to. |
@joker314 Update - see scratchfoundation/scratch-www@a60da11 - indeed, that was just a mistake in the PR code. Getting the curated studios list doesn't require auth. |
Latter two endpoints won't work until preview page is out. Test code: async function go() {
const projectID = 248475643
const studioID = 5542140
const token = await fetch('/session', {headers: {'X-Requested-With': 'XMLHttpRequest'}}).then(res => res.json()).then(data => data.user.token)
const res = await fetch(`https://api.scratch.mit.edu/studios/${studioID}/${projectID}?x-token=${token}`, {method: 'POST'})
console.log(res)
}
go().catch(err => console.error(err)) |
See scratchfoundation/scratch-www#1985. This is probably a big one!
/projects/<id>/studios
/users/<username>/studios/curate
/studios/<id>/project/<id>
(add to studio; requires auth)/studios/<id>/project/<id>
(remove from studio; requires auth)The text was updated successfully, but these errors were encountered: