AnsweredAssumed Answered

Append update to wiki page body without replacing entire body

Question asked by peter.wiarda@slcc.edu on Sep 21, 2017
Latest reply on Oct 13, 2017 by peter.wiarda@slcc.edu

I am trying to add a small bit of content, "MyUpdate", to a page using this example API request: 

var settings = {
   "async": true,
   "crossDomain": true,
   "url": "https://XXX.instructure.com/api/v1/courses/XXX/pages/XXX?wiki_page[body]=MyUpdate",
   "method": "PUT",
   "headers": {
      "authorization": "XXX",
      "cache-control": "no-cache"
   }
}
$.ajax(settings).done(function (response) {
   console.log(response);
});

But I don't want to have my update replace the existing wiki page body. I only want to append my update to the existing body content. In pseudocode it would be 'wiki_page[body]+=MyUpdate' if you know what I mean.

 

I have thought about getting the content from wiki_page[body], appending my update, then putting it back, but this doesn't always work because sometimes the page is a very large page and its content is too long and I get a "URI Too Long" error.

 

Does anyone know if it's possible to do what I'm trying to do? And can offer any solutions/suggestions?

 

Thank you!

Outcomes