Produce QR Code
Generate QR code images for URLs or phone numbers
Generates a QR code image for a given URL or telephone URI. Returns the image as a base64-encoded PNG string that can be embedded directly in HTML or saved as a file.
Requires a valid `api_key` and `developer_secret` in the JSON request body. Requests must originate from a whitelisted IP address.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
api_key |
body | string |
Yes | Your Zyntro API key |
developer_secret |
body | string |
Yes | Your developer secret (zdk_XXX). Issued during developer onboarding. |
url |
body | string |
Yes | The URL or `tel:` URI to encode into the QR code. Must start with `http://`, `https://`, or `tel:` |
size |
body | integer |
No | QR code size in pixels (width and height). Minimum: 100, Maximum: 1000. Default: 500 |
Request Body
Content-Type: application/json
Example
json
{
"url": "https://acme.com/pricing",
"size": 300,
"api_key": "YOUR_API_KEY",
"developer_secret": "YOUR_DEVELOPER_SECRET"
}
Code Samples
bash
curl -X POST https://app.zyntrohq.com/apis/v2/public/crm/produceQRCode \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"developer_secret": "YOUR_DEVELOPER_SECRET",
"url": "https://acme.com/pricing",
"size": 300
}'
bash
curl -X POST https://app.zyntrohq.com/apis/v2/public/crm/produceQRCode \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"developer_secret": "YOUR_DEVELOPER_SECRET",
"url": "tel:+15550123456"
}'
html
<!-- Use the base64 response directly in an img tag -->
<img src="data:image/png;base64,{BASE64_STRING}" alt="QR Code" />
Response
200
QR code generated
json
{
"data": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5f...",
"status": "success"
}
200
Error response
json
{
"data": [
"Invalid URL format"
],
"status": "error"
}
Tip:
The response `data` field contains a raw base64-encoded PNG string (no `data:image/png;base64,` prefix). To display it in HTML, prepend the data URI prefix: `data:image/png;base64,` followed by the returned string.
Errors
| Code | Message | Resolution |
|---|---|---|
MISSING_API_KEY |
API key is required The `api_key` field is missing. |
Include your API key. |
INVALID_API_KEY |
Invalid API key No active user matches the key. |
Verify your key. |
IP_NOT_WHITELISTED |
IP address not whitelisted The request originated from an IP not in the key's allowed list. |
Contact your client to add your IP to the developer key whitelist. |
INVALID_DEVELOPER_SECRET |
Invalid developer_secret The developer secret does not match any active key. |
Verify your developer secret. If lost, have your client revoke and reissue the key. |
MISSING_DEVELOPER_SECRET |
Missing developer_secret The `developer_secret` field is missing or empty. |
Include your developer secret in the request body. This is issued during developer onboarding. |
USER_INACTIVE |
User account is not active The account is deactivated. |
Contact your admin. |
MISSING_URL |
URL is required The `url` field is missing. |
Provide a URL or tel: URI. |
INVALID_URL |
Invalid URL format The URL does not start with http://, https://, or tel: |
Provide a valid URL or telephone URI. |
GENERATION_FAILED |
Failed to generate QR code The QR code service could not process the request. |
Verify the URL is properly formatted and try again. |