cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MatthewMoreno
Community Member

Internal server error when trying to create grade book column

Jump to solution

Im trying to make a custom grade book column, however, when trying to do so I get this error:

 

{
   "errors":
     [{
       "message":"An error occurred.",
       "error_code":"internal_server_error"}
     ],
      "error_report_id":519
}

 

The request is done in python and here is my code, most of it is taken from the custom gradebook column documentation

 

def post(self, request_url):
   total_url = self._api_url + request_url
   test_data = {
      "column": {
         "id": 2,
         "teacher_notes": False,
         "title": "Stuff",
         "position": 1,
         "hidden": False,
         "read_only": True,
      },
         "access_token": self._access_token
   }

    r = requests.post(total_url, data = test_data)
    print(r.text)

 

Im using pythons requests library to handle the http stuff.
total_url looks something like https://my-university.com/api/v1/courses/134/custom_gradebook_columns

Any help would be appreciated, thanks!

Labels (1)
Tags (1)
0 Kudos
2 Solutions

Accepted Solutions
jerry_nguyen
Community Participant

@MatthewMoreno 

I'm not using Python, however, the boolean value must be lower case (E.g. true, false - not True, False)

By the way, "id" is not part of the endpoint

{     
"column": {
         "title": "Stuff",
         "teacher_notes": false,
         "position": 1,
         "hidden": false,
         "read_only": true
      }
 }

 

View solution in original post

@MatthewMoreno 

Try 0 (false) and 1 (true) 

If you're using Python, you might want to consider using this Python Wrapper to access Canvas API: https://community.canvaslms.com/t5/InstructureCon-2017/PyCanvas-A-Python-Wrapper-for-the-Canvas-API-...

 

View solution in original post

4 Replies
jerry_nguyen
Community Participant

@MatthewMoreno 

I'm not using Python, however, the boolean value must be lower case (E.g. true, false - not True, False)

By the way, "id" is not part of the endpoint

{     
"column": {
         "title": "Stuff",
         "teacher_notes": false,
         "position": 1,
         "hidden": false,
         "read_only": true
      }
 }

 

View solution in original post

boolean values in python have their first char capitalized (True, False). Changing them to lowercase will throw an undefined error. I got rid of ID but still no luck. Still getting an internal server error.

@MatthewMoreno 

Try 0 (false) and 1 (true) 

If you're using Python, you might want to consider using this Python Wrapper to access Canvas API: https://community.canvaslms.com/t5/InstructureCon-2017/PyCanvas-A-Python-Wrapper-for-the-Canvas-API-...

 

View solution in original post

Using the CanvasAPI's create_custom_column method worked for me, thanks for bringing it to my attention!