Skip to content

Get Block

GET/blocks/:id

Retrieve a single block by its ID.

Parameters

ParameterDefaultValues / Description
includeimages

Request

js
import Confetti from 'confetti'

const confetti = new Confetti({ apiKey: 'your-key' })

const block = await confetti.blocks.find(210645)
sh
curl "https://api.confetti.events/blocks/210645" \
  -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
}
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
      }
    }
  }
}