Getting Started
Introduction
The QR Mark API enables you to programmatically secure documents by embedding verification QR codes. This API allows you to:
-
Create and manage verification records with unique QR codes
-
Design custom page templates for verification pages
-
Download and retrieve verification data
-
Manage templates and verifications programmatically
Base URL: {{BASE_URL}} i.e https://api.qrmark.com
Getting Started
Prerequisites
Before using the QR Mark API, you need:
-
API Key - Obtain from your QR Mark dashboard
-
Base URL - Your API endpoint base URL
-
HTTP Client - Postman, cURL, or any HTTP client library
API Key Validity Options
-
30 days
-
60 days
-
365 days
-
Never expire
Authentication
All API requests require authentication using an API key passed in the request header.
Authentication Method
Header-based API Key Authentication
Authorization: YOUR_API_KEY
Example Request
curl -X GET "{{BASE_URL}}/templates/page/template_123/" \
-H "Authorization: YOUR_API_KEY"
API Endpoints Overview
|
Endpoint |
Method |
Purpose |
|---|---|---|
|
|
POST |
Create a new verification with QR code |
|
|
GET |
Download/retrieve verification details |
|
|
DELETE |
Remove a verification record |
|
|
POST |
Create a new page template |
|
|
GET |
Fetch page template details |
|
|
DELETE |
Remove a page template |
Step-by-Step Workflows
Workflow 1: Creating Your First Verification QR Code
This workflow guides you through creating a verification QR code from scratch.
Step 1: Create a Page Template
Before creating verifications, you need a page template that defines what information will be displayed on the verification page.
Endpoint: POST {{BASE_URL}}/templates/
Request Body:
{
"name": "Product Authentication Template",
"link_original": true,
"content": {
"branding": {
"title": "Product Verification",
"subheading": "Scan to verify authenticity"
},
"verificationData": [
{
"fieldId": "uuid",
"fieldName": "Product ID",
"fieldType": "text",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Manufacture Date",
"fieldType": "date",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Batch Number",
"fieldType": "text",
"isRequired": false
}
]
}
}
Response:
{
"template_id": "tpl_abc123",
"name": "Product Authentication Template",
"created": "2024-01-15T10:30:00Z",
"modified": "2024-01-15T10:30:00Z",
"content": { ... }
}
Save the template_id for the next step.
Step 2: Fetch the Page Template (Optional but Recommended)
Retrieve the template structure to ensure you have the correct field IDs and names.
Endpoint: GET {{BASE_URL}}/templates/page/tpl_abc123/
Response:
{
"template_id": "tpl_abc123",
"name": "Product Authentication Template",
"content": {
"branding": {
"logo": "",
"title": "Product Verification",
"subheading": "Scan to verify authenticity"
},
"verificationData": [
{
"fieldId": "uuid",
"fieldName": "Product ID",
"fieldType": "text",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Manufacture Date",
"fieldType": "date",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Batch Number",
"fieldType": "text",
"isRequired": false
}
]
}
}
Step 3: Create a Verification with QR Code
Now create a verification record using the template. The fieldId and fieldName in your verification data must match those from the template.
Endpoint: POST {{BASE_URL}}/verification/?format=json
Request Body:
{
"name": "Product_XYZ_001",
"domain": "verify.yourcompany.com",
"page_template": "tpl_abc123",
"frame_template": "frame_001",
"verification_data": [
{
"fieldId": "same_uuid",
"fieldName": "Product ID",
"fieldValue": "XYZ-001-2024"
},
{
"fieldId": "same_uuid",
"fieldName": "Manufacture Date",
"fieldValue": "2024-01-15"
},
{
"fieldId": "same_uuid",
"fieldName": "Batch Number",
"fieldValue": "BATCH-2024-001"
}
]
}
Response:
{
"hash": "abc123def456",
"verification_data": [ ... ],
"image": "data:image/png;base64,iVBORw0KGgoAAAANS...",
"verification_url": "https://verify.yourcompany.com/v/abc123def456",
"created": "2024-01-15T11:00:00Z"
}
Key Response Fields:
-
hash- Unique identifier for this verification -
image- Base64-encoded QR code image (ready to use) -
verification_url- Public URL where users can verify the document -
created- Timestamp of creation
Step 4: Download/Retrieve the Verification
You can retrieve the verification details and QR code at any time using the hash.
Endpoint: GET {{BASE_URL}}/verification/download/abc123def456/?format=json
Query Parameters:
-
format- Optional, defaults toimage/png, can bejson
Response:
{
"name": "Product_XYZ_001",
"hash": "abc123def456",
"verification_data": [
{
"fieldId": "uuid",
"fieldName": "Product ID",
"fieldValue": "XYZ-001-2024"
},
{
"fieldId": "uuid",
"fieldName": "Manufacture Date",
"fieldValue": "2024-01-15"
},
{
"fieldId": "uuid",
"fieldName": "Batch Number",
"fieldValue": "BATCH-2024-001"
}
],
"image": "data:image/png;base64,iVBORw0KGgoAAAANS..."
}
Workflow 2: Managing Page Templates
This workflow shows how to create, retrieve, and delete page templates.
Step 1: Create a Page Template
Endpoint: POST {{BASE_URL}}/templates/
Request Body:
{
"name": "Certificate Template",
"link_original": false,
"content": {
"branding": {
"title": "Certificate Verification",
"subheading": "Verify the authenticity of this certificate"
},
"verificationData": [
{
"fieldId": "cert_number",
"fieldName": "Certificate Number",
"fieldType": "text",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Recipient Name",
"fieldType": "text",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Issue Date",
"fieldType": "date",
"isRequired": true
},
{
"fieldId": "uuid",
"fieldName": "Expiry Date",
"fieldType": "date",
"isRequired": false
}
]
}
}
Step 2: Retrieve the Template
Endpoint: GET {{BASE_URL}}/templates/page/:template_id/
Replace :template_id with the actual template ID from Step 1.
Step 3: Delete a Template (When No Longer Needed)
Endpoint: DELETE {{BASE_URL}}/templates/page/:template_id/
⚠️ Warning: This action is permanent and cannot be undone.
Response: 204 No Content (Success)