Creating Async Job, rejected because user_id=null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working on an LTI app, and am needing to send grades to Canvas in bulk. I'm using the endpoint:
POST /api/v1/courses/:course_id/assignments/:assignment_id/submissions/update_grades
This creates an async job and returns a progress object as expected. The job fails, however, because the submitted user id is null. There, however, does not seem to be a user id parameter for this end point, so I am not sure what to do to debug or how to make sure it is sent. Is this possibly a problem in the authorization process?
For reference, here is the progress query result:
while(1);{"id":2926799,"context_id":1876255,"context_type":"Course","user_id":null,"tag":"submissions_update","completion":null,"workflow_state":"failed","created_at":"2016-06-27T18:33:39Z","updated_at":"2016-06-27T18:33:40Z","message":"Couldn't find User(s) with API ids ''","url":~CANVAS URL~}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, my request was formulated correctly, and do know to check the progress url for the failed status, i just wasn't putting that down because I thought that the source of the error was showing up in the initial queued progress. That last bit on the failure scenario ended up sending me on the right path. I blame this one on a mix of stupidity and a misleading error message.
It turns out I was sending a null student ID. What threw me off was the message returned from the failed progress object: "message" : "Couldn't find User(s) with API ids ''", listed right below a field showing "user_id" : null. This led me to think that the user_id in the progress object being null was the problem, when the user id that was problematically null was the student ID I was submitting. So, problem solved.