cancel
Showing results for 
Search instead for 
Did you mean: 
gina_kayed
Community Member

curl 3 url malformed error

Jump to solution

Might anyone know why I'm receiving the following error when trying to use windows command to batch create courses via a csv using the SIS API call:  cmd error: curl: 3 url malformed?

I'm using the following command structure below, by prefixing the file location where my csv file is located, including my token and canvas url: C:\Users\me\Desktop\Canvas>curl -F attachment=@<filename> -H "Authorization: Bearer <token>" \'https://<canvas>/api/v1/accounts/<account_id>/sis_imports.json?import_type=instructure_csv'

Could it be because windows command doesn't support single quotes, which is what cURL statements use to specify JSON data? I also tried removing the backsplash to see if that could be the problem, but it wasn't.  Any ideas/suggestions on how to fix this?

  Thanks!

1 Solution

Accepted Solutions
dwahl_sales
Instructure
Instructure

Hi  @gina_kayed ​,

In documentation it is common to add an backslash \ to denote that a line continues, but it shouldn't actually be included in your command. So your command should be one line like this:

curl -F attachment=@<filename> -H "Authorization: Bearer <token>" 'https://<canvas>/api/v1/accounts/<account_id>/sis_imports.json?import_type=instructure_csv'

View solution in original post

5 Replies
Stefanie
Community Team
Community Team

 @gina_kayed ​, due to the technical nature of this question I've shared it with the Canvas Developers​ group.

Thanks Stefanie--appreciate your prompt response.  I was actually able to resolve this yesterday.  I removed the double quotes around my http address and it seemed to do the trick.  Of course if the canvas developers group have anything else to add/clarify, that would be welcomed.

Thanks again

dwahl_sales
Instructure
Instructure

Hi  @gina_kayed ​,

In documentation it is common to add an backslash \ to denote that a line continues, but it shouldn't actually be included in your command. So your command should be one line like this:

curl -F attachment=@<filename> -H "Authorization: Bearer <token>" 'https://<canvas>/api/v1/accounts/<account_id>/sis_imports.json?import_type=instructure_csv'

View solution in original post

Thanks Danny. Yes, that's right and I actually didn't include the

backsplash in my command. It appears as though removing the double quotes,

resolved the issue. Thanks again!

James
Community Champion

It's not just for documentation purposes -- the \ at the end of a line is a way to continue a line in certain shells (like BASH, which is the default with many Linux systems).