Skip to content

Content helpers

QR codes for WiFi credentials, contact cards (vCard) and geolocation use specific text formats. These endpoints assemble the payload string for you so you can feed it straight into /api/qr/generate as content.

All three endpoints accept JSON, return JSON. No rendering happens — they're pure string builders.

WiFi

POST /api/qr/content/wifi
{
  "ssid": "MyNetwork",
  "password": "supersecret",
  "encryption": "WPA",
  "hidden": false
}

Response:

{
  "success": true,
  "content": "WIFI:T:WPA;S:MyNetwork;P:supersecret;H:false;;"
}

encryption: WPA, WEP, or nopass.

vCard

POST /api/qr/content/vcard
{
  "firstName": "Ada",
  "lastName": "Lovelace",
  "organization": "Analytical Engine Co.",
  "title": "Programmer",
  "phone": "+44 20 7946 0958",
  "email": "ada@example.com",
  "url": "https://adalovelace.example",
  "address": "10 Downing St, London"
}

Response: a fully-formed vCard 3.0 string ready to encode.

Geo

POST /api/qr/content/geo
{
  "latitude": 40.4168,
  "longitude": -3.7038,
  "query": "Plaza Mayor, Madrid"
}

Response:

{
  "success": true,
  "content": "geo:40.4168,-3.7038?q=Plaza%20Mayor%2C%20Madrid"
}

query is optional — adds a label readable by Google Maps / Apple Maps.

Why these exist

You could build the strings yourself, but the formats have edge cases (escaping in WiFi passwords, line folding in vCard, URI-encoding in Geo). The helpers handle them so a typo doesn't leave a customer with a QR that opens "MyNetwork P:supersecret" as the SSID.

Pattern

1. POST to /api/qr/content/{wifi|vcard|geo}     → get the content string
2. POST that string as `content` to /api/qr/generate → get the QR

You can also pass the assembled string straight into the AI endpoint as content if you want the AI to style the WiFi/vCard/Geo QR.

Code samples