Problems Creating A Course With API

Jump to solution
aday
Community Explorer

Post URL: /api/v1/accounts/1/courses

I am trying to create a new course using the API and every time  is creates a course with none of my values filled in and gives it a name of 'Unnamed Course' I have tried stripping the payload down so i am basically only posting the name but still no luck.

Here are the two payloads I have tried:

#1. "{\"account_id\":1,\"course\":{\"id\":0,\"name\":\"AD Name\"}}"

#2. "{\"id\":0,\"name\":\"AD Name\"}"

I am not sure what i am doing wrong. Any help would be great.

Thanks

Labels (1)
2 Solutions
MattHanes
Community Champion

What programming language are you using? Can you post your entire code?

View solution in original post

aday
Community Explorer
Author

Thanks for your reply,

I got it to work. It turns out i was missing ContentType = "application/json" in my request.

Thanks for your help

View solution in original post