CanvasAPI - json objects

Jump to solution
Community Member

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





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! 

1 Solution
Community Champion


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.

View solution in original post