Links
Link Content allows you to link external articles (from other websites and CRMs) to Cerkl. Links behave very similarly to Stories, but they let the external URL do most of the work for you. When other content is linked with a
Adding Links
To add Links, POST
to the /link
endpoint:
$ curl --request POST 'api.cerkl.com/v3/link' \
--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",
"external_url": "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 Links
Links 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 Link Content).
Updating Links
To update an existing Link, utilize the PUT
method on the /link/{id}
endpoint, constructing your URL with the id
of the existing Link. If your Link’s ID is 12345
, that looks like this:
$ curl --request PUT 'api.cerkl.com/v3/link/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",
"external_url": "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 Links
To delete a Link, you just need to make a DELETE
request to the link/{id}
endpoint using the id
corresponding
to your Link. If our Link id
is still 12345
as it was above, that looks like this:
$ curl --location --request DELETE 'api.cerkl.com/v3/link/12345' \
--header 'Authorization: Bearer {ACCESS_TOKEN}'