I am trying to create a topic post when students complete an action. I am getting the dreaded St...

I am trying to create a topic post when students complete an action. I am getting the dreaded Status 400 error : Request has missing or invalid parameters. I have checked the API reference for CreatePostData.
Here is the sample code so far :
let postString = '{"ParentPostId": null, "Subject": "This is a test post via API", "Message": { "Content": " Test Content to be posted... ", "Type": "Html" }, "IsAnonymous": false }';
let sendURL = "/d2l/api/le/1.41/"+ orgUnitId +"/discussions/forums/"+ forumId +"/topics/"+ topicId +"/posts/";
$.ajax({
url: sendURL,
type: 'POST',
data: JSON.stringify(postString ),
headers: {
'X-CSRF-TOKEN':localStorage.getItem("XSRF.Token")
},
success: function(sendresult) {
.......
I am aware of the need for the XSRF token etc, and have successfully used PUT in the past, but this is just not working. The Forum and Topics exist and are not of "group-type"... Any ideas why? Thanks....
Categories
- All Categories
- 6 Thought Leadership
- 7 Known and Fixed Issues
- 6 Product Roadmap
- 553 Archived
- 10 Accessibility
- 27 Community Corner
- 2 Welcome
- Updates
- Member Spotlights
- 4 Events
- 242 Development
- 746 Customer Enablement
- Evaluate - Assess Student Learning
- Get Comfortable with Brightspace
- Communicate - Engage with Your Students
- 1 Create - Set up your Brightspace course
- Action - Add or create student activities
- 26 Partners
- 8 Product News
- 2022
- 2022 Release Notes
- 2021 Release Notes
- 4 Training
- andycat