Author API Methods
getItem()
Gets the current Item JSON of the Item being edited.
You would want to use this method so that you can store the Item JSON in your own database, for example.
Returns itemJson, the current Item JSON, or false if not editing an Item.
Examples
var itemJSON = authorApp.getItem();
console.log(itemJSON);
Arguments
None.
Return value
Type object
-
features array[widgetObject]
Array of Widget objects for Features in the Item.
-
item object
The settings and contents of the Item.
-
questions array[widgetObject]
Array of Widget objects for Questions in the Item.
Caveats
When an Item contains Questions or Features added via the Item editor, the definition.widgets array returned by getItem() may include a widget_type field on each widget object (for example, "widget_type": "response" or "widget_type": "feature"). This field is an internal artifact of how the Item editor's region tree renders the layout, and it should be treated as read-only and has no meaningful use outside the editor. It is not required when constructing or updating Item definitions via setItemJson() method or Data API's Set Items endpoint, and Data API will strip it from the stored definition if present.
Related articles
- The
setItemJson()method, which allows you to overwrite the current Item JSON.