Skip to content

ezprestapi 1.2.9: REST v2 updates content; the writes need no nxc_powercontent

Choose a tag to compare

@se7enxweb se7enxweb released this 12 Nov 16:55
· 3 commits to main since this release

REST API v2 updates content, and the content writes no longer need nxc_powercontent.

  • Update: POST or PUT /api/ezp/v2/content/node/<node id> publishes a new version of the node's object with the attribute values sent; the other attributes keep their values. languageLocale (optional, the object's main language by default) can name a language the object does not have yet, which adds that translation. The new version goes through the publish operation, so workflows run. Answers 200 with objectId, nodeId, version and languageLocale, or 202 when a workflow holds the publication; 400 for no values, an unknown attribute, a value that is not text, a file that is not a public URL or an unknown language; 403 without content/edit in that language; 404 for an unknown node. Personal API keys need the edit scope.
  • Writes through the kernel: create, update and delete are written by the kernel's expContentWriter (Exponential 6.0.15 or later). se7enxweb/nxc_powercontent is no longer required. On an older kernel the write calls answer 501; reads work as before.
  • JSON bodies: create and update take a JSON object (Content-Type: application/json) as well as form fields.
  • Values: rich text as HTML, a file as a public http(s) address (optionally URL|alternative text), every other datatype in its text form. A path on the server is no longer read for a file value, and addresses that resolve to private, loopback, link-local or reserved networks are refused.

Requires Exponential 6.0.15 or later for the writes.