Basic

A simple and clean template for OG images.

Dimensions: 1024x630
Template ID: basic

Properties

PropertyTypeRequiredMax LengthValidation
title
Main title or name
stringYes50maxLength(50)
email
Email address
stringYes-email
tel
Phone number
stringYes12maxLength(12)
imageUrl
Image URL (HTTPS only)
string (URL)Yes-url (HTTPS only)
primaryColor
Background color
string (hex)Yes-color (hex)
textColor
Text color
string (hex)Yes-color (hex)

Example

{
  "template": "basic",
  "title": "John Doe",
  "email": "[email protected]",
  "tel": "+12345678900",
  "imageUrl": "https://example.com/image.jpg",
  "primaryColor": "#8b5cff",
  "textColor": "#000000"
}

Code examples

const response = await fetch("https://assets.qbacode.com/api/v1/generate-asset", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
        "template": "basic",
        "title": "John Doe",
        "email": "[email protected]",
        "tel": "+12345678900",
        "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);
}