Events
Event Content represents an upcoming event that you would like to announce to your Cerkl Subscribers in their News Digests. Events include information about the Event location, start and end times, and links to any registration links your Subscribers need to know about.
Adding Events
To add Events, POST
to the /event
endpoint:
$ curl --request POST 'api.cerkl.com/v3/event' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--data-raw '{
"template": {
"version": "string",
"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",
"private": <bool>,
"segments": [
{
"id": <integer>,
"self": "string"
}
],
"exclusive_to_segment": <bool>,
"available_in_aptly": <bool>,
"enable_comments": <bool>,
"enable_link_tracking": <bool>,
"event_location": "string",
"event_street_address": "string",
"event_city": "string",
"event_postal_code": "string",
"event_region": "string",
"event_country": "string",
"event_all_day": <bool>,
"event_start_date_time_utc": "string",
"event_end_date_time_utc": "string",
"event_time_zone": {
"id": <integer>,
"self": "string"
},
"event_registration_url": "string",
"external_url": "string",
"status": {
"id": <integer>,
"self": "string"
},
"self": "string"
}
]
}
}'
Retrieving Events
Events 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 Event Content).
Updating Events
To update an existing Event, utilize the PUT
method on the /event/{id}
endpoint, constructing your URL with the id
of the existing event. If your Event’s ID is 12345
, that looks like this:
$ curl --request PUT 'api.cerkl.com/v3/event/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>
},
"priority_until_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>,
"event_location": "string",
"event_street_address": "string",
"event_city": "string",
"event_postal_code": "string",
"event_region": "string",
"event_country": "string",
"event_all_day": <bool>,
"event_start_date_time_utc": "string",
"event_end_date_time_utc": "string",
"event_time_zone": {
"id": <integer>,
"self": "string"
},
"event_registration_url": "string",
"external_url": "string",
"status": {
"id": <integer>,
"self": "string"
},
"self": "string"
}
]
}
}'
Deleting Events
To delete an Event, you just need to make a DELETE
request to the event/{id}
endpoint using the id
corresponding
to your Event. If our Event id
is still 12345
as it was above, that looks like this:
$ curl --location --request DELETE 'api.cerkl.com/v3/event/12345' \
--header 'Authorization: Bearer {ACCESS_TOKEN}'