Khan / khan-api

Documentation for (and examples of) using the Khan Academy API
http://www.khanacademy.org
377 stars 75 forks source link

Cannot get student information from the API of a logged-in Teacher #117

Closed 23harolds closed 7 years ago

benjaminjkraft commented 7 years ago

Hi @23harolds,

Can you give us more information about the issue you're seeing? Which API call are you using? What response are you getting back?

23harolds commented 7 years ago

We are using the User API's. The API is requiring a log-in. We used an account of a Teacher in Khan Academy to login. Then upon making a GET request like for example: /api/v1/user/exercises?email=harold.sabanal@gmail.com, the API doesn't give any output: neither a result nor an error given that the email provided is an email addresss of a student enrolled in the class of the teacher who was authenticated during the login to the API.

Thank you so much for your help.

benjaminjkraft commented 7 years ago

To what domain are you making the requests? And are you getting a status code in the response? I'm wondering if this is the same issue as #115.

23harolds commented 7 years ago

What do you mean by "To what domain"? Emails can have different domains right? Basically we have our own domain: sgen.edu.ph

I'm not getting any status code nor any response. The screen is just blank.

benjaminjkraft commented 7 years ago

Sorry, what I mean is, are you hitting www.khanacademy.org/api/v1/..., or something else?

23harolds commented 7 years ago

We are hitting at http://www.southville.edu.ph/khan/ka_client.php. I tried hitting from www.khanacademy.org/api/v1/user but it returned an unauthorized error given that I am logged-in to my Khan Academy account.

23harolds commented 7 years ago

Any words/suggestions from you @benjaminjkraft ? Grateful for your help.

benjaminjkraft commented 7 years ago

Without knowing exactly what your code is doing it's hard to know what the issue is -- so all I can really say is to make sure you're following the instructions at https://github.com/Khan/khan-api/wiki/Khan-Academy-API-Authentication to authenticate the request. If you can give a bit more information about exactly how you're constructing and authorizing the OAuth request, we may be able to be of more assistance.