Basic

Una plantilla simple y limpia para imágenes OG.

Dimensiones: 1024x630
Template ID: basic

Propiedades

PropiedadTipoRequeridoLong. MáximaValidación
username
Título o nombre principal
string50maxLength(50)
email
Dirección de correo electrónico
string-email
phone
Número de teléfono
stringNo16maxLength(16)
description
Descripción breve
stringNo100maxLength(100)
skills
Habilidades o tecnologías
stringNo100maxLength(100), comma-separated, no more than 6 skills
imageUrl
URL de la imagen (solo HTTPS)
string (URL)-url (HTTPS only)
primaryColor
Color de fondo
string (hex)-color (hex)
textColor
Color del texto
string (hex)-color (hex)

Ejemplo

{
  "template": "basic",
  "username": "John Doe",
  "email": "[email protected]",
  "phone": "+(123) 4567 8900",
  "description": "A passionate developer and tech enthusiast.",
  "skills": "JavaScript, React, Node.js",
  "imageUrl": "https://example.com/image.jpg",
  "primaryColor": "#8b5cff",
  "textColor": "#000000"
}

Ejemplos de código

const response = await fetch("https://assets.qbacode.com/api/v1/generate-asset", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
        "template": "basic",
        "username": "John Doe",
        "email": "[email protected]",
        "phone": "+(123) 4567 8900",
        "description": "A passionate developer and tech enthusiast.",
        "skills": "JavaScript, React, Node.js",
        "imageUrl": "https://example.com/image.jpg",
        "primaryColor": "#8b5cff",
        "textColor": "#000000"
    })
});

if (response.ok) {
  const blob = await response.blob();
  const imageUrl = URL.createObjectURL(blob);
  document.getElementById("preview").src = imageUrl;
} else {
  const error = await response.json();
  console.error("Error:", error);
}