CanvasAPI - json objects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021
09:50 AM
I'm new to Python and CanvasAPI, and I'm learning the ropes of calling information. I'm seeking to print off the json display of a get_submission request for a single assignment. Here's my code thus far:
canvas = Canvas(API_URL, API_KEY)
test_course = canvas.get_course("course_id")
assignment = test_course.get_assignment("assignment_id")
submission = assignment.get_submission("user_id")
print(submission)
The output is just the "assignment_id"-"user_id" (eg. 12345-6789)
The output I'm looking for is the actual .json for get_submission, as displayed here. What am I missing?
Many thanks for any assistance!
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021
03:30 PM
I don't know Python so this may be way off. I think submission is an object, but print(submission) converts it to a string. You need to figure out how, in Python, to print an object.