Obtener bloque CMS
curl --request GET \
--url https://api.example.com/cms/blocks/{name}import requests
url = "https://api.example.com/cms/blocks/{name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/cms/blocks/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/cms/blocks/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/cms/blocks/{name}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/cms/blocks/{name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/cms/blocks/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "home-hero",
"status": "ACTIVE",
"items": [
{
"id": "11111111-1111-1111-1111-111111111111",
"type": "TEXT",
"key": "headline",
"label": "Titular",
"text": "Pide en anticipado"
},
{
"id": "22222222-2222-2222-2222-222222222222",
"type": "LIST",
"key": "banners",
"label": "Banners",
"item_type": "IMAGE",
"items": [
{
"id": "33333333-3333-3333-3333-333333333333",
"type": "IMAGE",
"url": "https://example.com/banner-1.jpg",
"alt": "Oferta de verano"
},
{
"id": "44444444-4444-4444-4444-444444444444",
"type": "IMAGE",
"url": "https://example.com/banner-2.jpg",
"alt": "Menú nuevo"
}
]
}
]
}
}
CMS
Obtener bloque CMS
Obtiene un bloque CMS ACTIVE por su nombre reservado para el merchant y environment.
GET
/
cms
/
blocks
/
{name}
Obtener bloque CMS
curl --request GET \
--url https://api.example.com/cms/blocks/{name}import requests
url = "https://api.example.com/cms/blocks/{name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/cms/blocks/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/cms/blocks/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/cms/blocks/{name}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/cms/blocks/{name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/cms/blocks/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "home-hero",
"status": "ACTIVE",
"items": [
{
"id": "11111111-1111-1111-1111-111111111111",
"type": "TEXT",
"key": "headline",
"label": "Titular",
"text": "Pide en anticipado"
},
{
"id": "22222222-2222-2222-2222-222222222222",
"type": "LIST",
"key": "banners",
"label": "Banners",
"item_type": "IMAGE",
"items": [
{
"id": "33333333-3333-3333-3333-333333333333",
"type": "IMAGE",
"url": "https://example.com/banner-1.jpg",
"alt": "Oferta de verano"
},
{
"id": "44444444-4444-4444-4444-444444444444",
"type": "IMAGE",
"url": "https://example.com/banner-2.jpg",
"alt": "Menú nuevo"
}
]
}
]
}
}
Devuelve un bloque CMS por su
Busca un slot con
Consulta CMS para plantillas, bloques y tipos de ítem.
name único. Úsalo después de reservar un nombre en el dashboard (por ejemplo legal-tos) para que el storefront renderice texto, imágenes, videos o documentos.
Requiere un access token de Fire spark obtenido mediante intercambio de
token.
Parámetros de path
| Parámetro | Obligatorio | Descripción |
|---|---|---|
name | Sí | Nombre reservado del bloque. Solo minúsculas, números y guiones (ej. legal-tos). Único por merchant y environment. |
Request
curl "https://firespark.cloud/api/storefront/v1/cms/blocks/legal-tos" \
-H "Authorization: Bearer ACCESS_TOKEN"
Response
La respuesta envuelve un solo bloque endata.
{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "home-hero",
"status": "ACTIVE",
"items": [
{
"id": "11111111-1111-1111-1111-111111111111",
"type": "TEXT",
"key": "headline",
"label": "Titular",
"text": "Pide en anticipado"
},
{
"id": "22222222-2222-2222-2222-222222222222",
"type": "LIST",
"key": "banners",
"label": "Banners",
"item_type": "IMAGE",
"items": [
{
"id": "33333333-3333-3333-3333-333333333333",
"type": "IMAGE",
"url": "https://example.com/banner-1.jpg",
"alt": "Oferta de verano"
},
{
"id": "44444444-4444-4444-4444-444444444444",
"type": "IMAGE",
"url": "https://example.com/banner-2.jpg",
"alt": "Menú nuevo"
}
]
}
]
}
}
items.find(i => i.key === "banners"). Si type es LIST, renderiza items en orden.
Límites
| Restricción | Valor |
|---|---|
| Ítems de primer nivel por bloque | 1–25 |
Entradas por LIST | 1–10 |
| Imagen | ≤ 5 MB |
| Video | ≤ 50 MB |
| Documento | ≤ 10 MB |
Errores
| Status | Descripción |
|---|---|
401 | Access token ausente o inválido. |
404 | No hay bloque ACTIVE con el name indicado. |