AnsweredAssumed Answered

Upload files via API

Question asked by Arnar Leifsson on Feb 7, 2018
Latest reply on Feb 7, 2018 by Arnar Leifsson

I am trying to upload files via the API and have carefully followed the instructions Uploading Files - Canvas LMS REST API Documentation, available here. I am uploading via POST and using C# and RestSharp. Every time I get to step 3, I get an answer from the server Unprocessable Entity with a status code 422. Does the server want the file encoded in a specific way? I am providing it with a byte array[].

 

Below is the code that executes the request (generic HTTP encapsulation method):

 

This is the code which executes the generic HTTP encapsulation method, providing with the (I think) correct parameters:

 

 

 

Any ides what I am doing wrong? Step 1 and 2 are both successful and according to the documentation.

Outcomes