List Blocks
GET
/blocksRetrieve a paginated list of blocks.
Parameters
| Parameter | Default | Values / Description |
|---|---|---|
filter[pageId] | number | |
filter[eventId] | number | |
page[size] | 50 | Maximum number of results per page |
page[number] | 1 | Page number |
include | images |
Fields marked with * are required.
Request
js
import Confetti from 'confetti'
const confetti = new Confetti({ apiKey: 'your-key' })
const blocks = await confetti.blocks.findAll({
filter: { pageId: 1 },
page: { size: 10, number: 1 },
})sh
curl "https://api.confetti.events/blocks?filter[pageId]=1" \
-H "Authorization: apikey your-key"Response
ts
interface Block {
id: number
type: string
content: string
order: number
status: string
}json
[
{
"id": "210645",
"type": "text",
"status": "published",
"order": 2,
"content": {
"html": "<h3>This is a headline</h3><p>Here is a longer text about your event.</p>",
"showSocial": true,
"showRsvpButton": false
},
"images": null
},
{
"id": "210645",
"type": "text",
"status": "published",
"order": 2,
"content": {
"html": "<h3>This is a headline</h3><p>Here is a longer text about your event.</p>",
"showSocial": true,
"showRsvpButton": false
},
"images": null
}
]json
{
"data": [
{
"id": "210645",
"type": "block",
"attributes": {
"type": "text",
"status": "published",
"order": 2,
"content": {
"html": "<h3>This is a headline</h3><p>Here is a longer text about your event.</p>",
"showSocial": true,
"showRsvpButton": false
}
},
"relationships": {
"images": {
"data": null
}
}
},
{
"id": "210645",
"type": "block",
"attributes": {
"type": "text",
"status": "published",
"order": 2,
"content": {
"html": "<h3>This is a headline</h3><p>Here is a longer text about your event.</p>",
"showSocial": true,
"showRsvpButton": false
}
},
"relationships": {
"images": {
"data": null
}
}
}
]
}