API

This page describes the API exposed by the Presentation Preview plugin.

Upon plugin activation, the plugin will expose an API endpoint where one can POST data to be previewed. The currently active theme will be used to generate an HTML page that will be returned as response.

NOTE The endpoint only supports Content-Type application/json so make sure to set the header.

POST /preview-api/v1/article

Data

uuid (string) - The uuid of the article

meta (object) - Any extra metadata se below for more information

content (string|xml) - The article body in NewsML format.

Meta options

imengine (string) - URL to different Imengine that can be used for article images

concepts (array) - list off uuids to related concepts.

articles (array) - list off uuids to related articles.

Example Data:

{
	"data": {
	    "uuid": "uuid",
	    "meta": {
	        "imengine" : "https://example.imengine.io",
	        "concepts": [
              "uuid"
            ],
	    	"articles": [
              "uuid"
            ]
	    },
	    "content" : "NewsML idf xml here!"
	}
}

Response

Success

{
    "success": true,
    "data": {
        "content": "Preview HTML"
    }
}

Error

{
    "success": false,
    "data": {
        "message": "Error message"
    }
}

Last updated