Help posting an announcement through the API?

Jump to solution
david_joyner
Community Novice

Hi!

I'm working on a script that can post announcements through the Canvas API. I've worked with the API a good bit before, but never with discussion topics, and I'm running into a 422 error.

I'm attempting to create the topic with a call to

PUT /api/v1/courses/123/discussion_topics‍

...with three parameters:

{"title": "Hello World", "message": "hello world", "is_announcement": "true"}‍

However, I'm getting a 422 error with that, and I'm not sure why; I'm guessing there's a required parameter I'm not passing, but I don't know which it would be. Never mind, it's not that as I could post with just course ID and message from the live API.

Labels (1)
0 Likes
1 Solution
pklove
Community Champion

Topic creation should be a POST, not a PUT.

View solution in original post