JSON format for error?

11 views
Skip to first unread message

Kumi Hagimoto

unread,
Mar 27, 2015, 4:49:46 PM3/27/15
to canvas-l...@googlegroups.com
Hi all,

Is there a documentation somewhere on the JSON format of the API error?  So far I've found these by experimenting with different calls:
(StatusCode Description JSON)

*   403 Forbidden: {"message":"Can't add an enrollment to a concluded course."}
*   401 Unauthorized {"status":"unauthenticated","errors":[{"message":"user authorization required"}]}
*   404 Not Found {"errors":[{"message":"The specified resource does not exist."}],"error_report_id":150244839}

I have a method to parse API error, and it covers 401 and 404, but not 403, since it does not follow the format as the other two.   Note, all three are different, too.   If there is a documentation somewhere on the different formats for different status codes, I'd like to know, so I can update my object/method.

Thanks!
Kumi
Reply all
Reply to author
Forward
0 new messages