You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get a profile you would need to first get the current user which is already a GET request and then get the profile which is another GET request, but what if I already have the user_id. It should be possible to directly insert the id into /api/v1/users/:user_id/profile.
But I can't seem to be able to find a way; what I am doing right now is: profile = Canvas(URL, API_KEY).get_current_user().get_profile().
But this makes two request:
INFO:canvasapi.requester:Request: GET https://uncc.instructure.com/api/v1/users/self
INFO:canvasapi.requester:Request: GET https://uncc.instructure.com/api/v1/users/264631/profile
How can I make a request to the profile directly, with only one GET request, if I know the user_id already? I also have this problem when getting assignments for a course but needing to use get_course before getting the assignment even though I already know the course id.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
To get a profile you would need to first get the current user which is already a GET request and then get the profile which is another GET request, but what if I already have the user_id. It should be possible to directly insert the id into
/api/v1/users/:user_id/profile
.But I can't seem to be able to find a way; what I am doing right now is:
profile = Canvas(URL, API_KEY).get_current_user().get_profile()
.But this makes two request:
How can I make a request to the profile directly, with only one GET request, if I know the user_id already? I also have this problem when getting assignments for a course but needing to use get_course before getting the assignment even though I already know the course id.
Beta Was this translation helpful? Give feedback.
All reactions