The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December.
Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
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.
Solved! Go to Solution.
Topic creation should be a POST, not a PUT.
The discussion topics documentation says that is_announcement "requires announcment[sic]-posting permissions." Do you have those?
I do, my account is an instructor for the section.
Topic creation should be a POST, not a PUT.
I tell my CS students that the longer it takes you to find an error, the easier it is to fix once you find it.
I'm glad to be able to demonstrate that to them, too. That was it, thanks Peter!
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in