I’m attempting to use the new Universal Content APIs to fetch universal content blocks for a brand (https://developers.klaviyo.com/en/reference/get_all_universal_content). I’m trying to render the block outside of Klaviyo, but the response from the API seems to not include any information about the actual content of the block (e.g the HTML that backs it). Here’s an example response I get from hitting the endpoint:
Request:
curl --request GET \
--url 'https://a.klaviyo.com/api/template-universal-content?=&page%5Bsize%5D=20' \
--header 'Authorization: Klaviyo-API-Key pk_xxx' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'revision: 2024-10-15'
Response:
{
"data": [
{
"type": "template-universal-content",
"id": "xxx",
"attributes": {
"name": "Products",
"definition": {
"content_type": "block",
"type": "product",
"data": null
},
"created": "2025-02-06T12:52:13.422807+00:00",
"updated": "2025-02-06T12:52:16.070859+00:00",
"screenshot_status": "completed",
"screenshot_url": "https://klaviyo-template-thumbnails.s3.amazonaws.com/saved_content/xxx"
},
"links": {
"self": "https://a.klaviyo.com/api/template-universal-content/xxx/"
}
}
],
"links": {
"self": "https://a.klaviyo.com/api/template-universal-content?page%5Bsize%5D=20",
"next": null,
"prev": null
}
}
So a few questions:
- Is it expected that this is the only data returned in the response? The documentation (https://developers.klaviyo.com/en/reference/universal_content_api_overview) seems to indicate that `data` returns either the text or HTML of the block, so I was expecting the HTML of the content to be returned (or something I can use besides a representative screenshot), but perhaps I’m misunderstanding how it works.
- If it’s not expected, when are the various optional parameters in `data` returned?