Deleting an Object Body

You can delete only an object body from a KiiObject.

Call the deleteBody() method to delete an object body as shown in the following sample code:

  • // Assume that the KiiObject "object" has been instantiated.
    
    // Delete the object body of the KiiObject.
    object.deleteBody().then(
      function(theObject) {
        // Do something.
      }
    ).catch(
      function(error) {
        var theObject = error.target;
        var errorString = error.message;
        // Handle the error.
      }
    );
  • // Assume that the KiiObject "object" has been instantiated.
    
    // Delete the object body of the KiiObject.
    object.deleteBody({
      success: function(theObject) {
        // Do something.
      },
      failure: function(theObject, errorString) {
        // Handle the error.
      }
    });

The deleteBody() method deletes only an object body. It does not delete a KiiObject.

If you delete an object body that has been published, its URL will be disabled too. JSON data representing an error will be returned if a user tries to access the disabled URL with a browser.