Save Content - Legacy

Last Updated: Jul 27, 2021
documentation for the dotCMS Content Management System


The Content API has been deprecated. New applications should use the [Workflow REST API](workflow-rest-api), and existing applications using the Content API should migrate to using the Workflow API as soon as practical.

Support for posting content using the Content API may be removed in a future release.

Here is an example of a form that will perform a simple post and simple redirect upon posting the content.

<script type="text/javascript" >
    $(document).ready(function() {
    $("#webup").submit(function(e) {
      var dataObj= {
      'title': $('#title').val(),
      'body': $('#body').val(),
      'contentHost': '',
      'stName': 'webPageContent'
          url: '/api/content/save/1',
          type: 'POST',
          cache: false,
          data: dataObj,
          beforeSend: function (request){

          request.setRequestHeader("DOTAUTH", window.btoa(""));
        success: function(data,status,xhr) {
          window.location = "";
        error: function(data,status,xhr) {
          alert("fail: " + data);
<form id="webup">
    <div class="form-group">
    <label for="title" class="required">Title</label>
    <input type="text" class="form-control" id="title" name="title" value="Here is a title">
    <div class="form-group">
    <label for="body" class="required">Body</label>
    <textarea id="body" name="body" >Here is some texttest</textarea>
    <div class="form-group">
      <input type="submit" value="Give 'er a go" />

On this page


We Dig Feedback

Selected excerpt: