Link

Stories

Stories are articles that you are presenting to your Cerkl Subscribers. These can include company-wide communications that you want to appear in your Subscribers’ personalized News Digests and articles you think different people in your Audience might find interesting.

Adding Stories

To add Stories, POST to the /story endpoint:

    $ curl --request POST 'api.cerkl.com/v3/story' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Bearer {ACCESS_TOKEN}' \
        --data-raw '{
            "template": {
                "version": "3.0",
                "data": [
                {
                    "author": {
                        "id": <integer>,
                        "self": "string"
                    },
                    "title": "string",
                    "summary": "string",
                    "body": "string",
                    "more_button_text": "string",
                    "image_url": "string",
                    "categories": [
                        {
                            "id": <integer>,
                            "self": "string"
                        }
                    ],
                    "external_id": "string",
                    "priority": {
                        "id": <integer>,
                        "self": "string"
                    },
                    "priority_until_date_utc": "string",
                    "publish_date_utc": "string",
                    "expiration_date_utc": "string",
                    "private": <bool>,
                    "segments": [
                        {
                            "id": <integer>,
                            "self": "string"
                        }
                    ],
                    "exclusive_to_segment": <bool>,
                    "available_in_aptly": <bool>,
                    "enable_comments": <bool>,
                    "enable_link_tracking": <bool>,
                    "status": {
                        "id": <integer>,
                        "self": "string"
                    },
                    "evergreen": <bool>,
                    "self": "string"
                }
            ]
        }
    }'

Retrieving Stories

Stories are pieces of Content, and can be retrieved using the GET method on the /content or /content/{id} endpoints (depending on whether you need all Content or just the specific Story Content).

Updating Stories

To update an existing Story, utilize the PUT method on the /story/{id} endpoint, constructing your URL with the id of the existing Story. If your Story’s ID is 12345, that looks like this:

    $ curl --request PUT 'api.cerkl.com/v3/story/12345' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Bearer {ACCESS_TOKEN}' \
        --data-raw '{
            "template": {
                "version": "3.0",
                "data": [
                {
                    "id": <integer>,
                    "author": {
                        "id": <integer>,
                        "self": "string"
                    },
                    "title": "string",
                    "summary": "string",
                    "body": "string",
                    "more_button_text": "string",
                    "image_url": "string",
                    "categories": [
                        {
                            "id": <integer>,
                            "self": "string"
                        }
                    ],
                    "external_id": "string",
                    "priority": {
                        "id": <integer>,
                        "self": "string"
                    },
                    "priority_until_date_utc": "string",
                    "publish_date_utc": "string",
                    "expiration_date_utc": "string",
                    "private": <bool>,
                    "segments": [
                        {
                            "id": <integer>,
                            "self": "string"
                        }
                    ],
                    "exclusive_to_segment": <bool>,
                    "available_in_aptly": <bool>,
                    "enable_comments": <bool>,
                    "enable_link_tracking": <bool>,
                    "status": {
                        "id": <integer>,
                        "self": "string"
                    },
                    "evergreen": <bool>,
                    "self": "string"
                }
            ]
        }
    }'

Deleting Stories

To delete an Story, you just need to make a DELETE request to the Story/{id} endpoint using the id corresponding to your Story. If our Story id is still 12345 as it was above, that looks like this:

    $ curl --location --request DELETE 'api.cerkl.com/v3/story/12345' \
        --header 'Authorization: Bearer {ACCESS_TOKEN}'