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

Options

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....