Help posting an announcement through the API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2019
11:43 AM
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.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2019
05:01 PM
Topic creation should be a POST, not a PUT.