Problem creating new course

Jump to solution
SanazPejman
Community Member

hello and good day,

I am tying to create a course by APIs in my locally installation! but the problem is I pass all parameters but in the result my course name is 'Unnamed course' !! and it can't pass my parameters to save! what is my problem?

 

Thanks.

 

 

1 Solution
matthew_buckett
Community Contributor

Thanks, that makes it easier to see what's going wrong, I think your JSON isn't correctly structured, it should be something like:

{"course": {"name": "curl created"}}

Here is an example request using the curl command line tool (authentication header removed) that created a correctly named course:

ccurl -H 'content-type: application/json'  --data '{"course": {"name": "curl created"}}' https://instance.instructure.com/api/v1/accounts/1/courses

And this works for me.

View solution in original post