# Preview API

Presentation Preview plugin depends on a frontend API to render a close to truth and very production-like HTML preview. Each web site (or product) needs to present the API as described in this documentation.

Naviga Web provides this API as part of the product, but with this documentation it should be possible to create a similar API with other Web presentations also.

![](https://532980669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRvOnE7vYlmaicCuJ4zYS%2Fuploads%2FLmQp7ZAYKpyNFfuD6Ru9%2Fimage.png?alt=media\&token=f81b6dd4-968c-487b-b942-0eb46a7b87f3)

## API docs

## Article preview

<mark style="color:green;">`POST`</mark> `example.com/preview-api/v1/article`

Responds with html page representing similar to how that article would look like on this site/product.

#### Query Parameters

| Name                                   | Type   | Description           |
| -------------------------------------- | ------ | --------------------- |
| body<mark style="color:red;">\*</mark> | String | Json as example below |

{% tabs %}
{% tab title="200: OK Rendered article response application json" %}
{% code title="Response" %}

```json
{
  "success": true,
  "content": "article page as html here"
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Not a valid API request" %}
{% code title="Response" %}

```javascript
{
    "success": false
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Request body" %}

```json
{
  "data": {
    "uuid": "article uuid here!" // Optional
    "meta": {
      "imengine" : "https://yes.hello", // The url of the editorial Imengine
      "concepts":  // Related concepts here
      [
        "13e5896f-e9c7-4481-8bb4-bd48bb69943d",
        "90a0891b-2804-4c89-9515-d042c2f23e18"
      ],
      "articles": // Related articles here
      [
        "13e5896f-e9c7-4481-8bb4-bd48bb69943d",
        "90a0891b-2804-4c89-9515-d042c2f23e18"
      ]
    },
    "content" : "NewsML idf xml here! Kan be found on the property 'BodyRaw' in public OC."
  }
}
```

{% endcode %}

{% hint style="info" %}
**Hint:** Presentation preview API response needs to be HTML, but it's not limited to Web sites only. You could in theory build your own renderer to simulate newsletters, mobile apps or other products if you like, as long as they provide this API.
{% endhint %}
