API Documentation
API Overview
The QR Igniter REST API provides programmatic access to all platform features. The API follows RESTful conventions and uses JSON for request/response bodies.
| Property | Value |
|---|---|
| Base URL | https://qr2.ignited.cloud/api/v1 |
| Format | JSON |
| Authentication | Bearer Token (Laravel Sanctum 4.3) |
| Rate Limiting | 1000 requests/minute |
| API Version | v1 |
Response Format
All API responses follow a consistent format:
{
"data": { ... },
"message": "Success message",
"meta": {
"current_page": 1,
"per_page": 15,
"total": 100
}
}
Error Responses
{
"message": "The given data was invalid.",
"errors": {
"gtin": [
"The gtin must be 14 characters.",
"The gtin check digit is invalid."
]
}
}
Authentication
The API uses Laravel Sanctum 4.3 for token-based authentication. All API requests (except login) require a valid bearer token.
Obtaining a Token
curl -X POST https://qr2.ignited.cloud/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your-password"
}'
Response:
{
"data": {
"token": "1|abc123xyz...",
"token_type": "Bearer",
"expires_at": "2025-12-20T00:00:00Z"
}
}
Using the Token
curl -X GET https://qr2.ignited.cloud/api/v1/qr-codes \
-H "Authorization: Bearer 1|abc123xyz..." \
-H "Accept: application/json"
Token Abilities (Scopes)
| Scope | Description |
|---|---|
clients:read |
Read client information |
clients:write |
Create/update clients |
qr-codes:read |
Read QR code information |
qr-codes:write |
Create/update/delete QR codes |
analytics:read |
Access analytics data |
batch:write |
Perform batch operations |
API Endpoints
Clients
| Method | Endpoint | Description |
|---|---|---|
GET |
/clients | List all clients |
POST |
/clients | Create a new client |
GET |
/clients/{id} | Get a specific client |
PUT |
/clients/{id} | Update a client |
DELETE |
/clients/{id} | Delete a client |
Brands
| Method | Endpoint | Description |
|---|---|---|
GET |
/brands | List all brands |
POST |
/brands | Create a new brand |
GET |
/brands/{id} | Get a specific brand |
PUT |
/brands/{id} | Update a brand |
DELETE |
/brands/{id} | Delete a brand |
QR Codes
| Method | Endpoint | Description |
|---|---|---|
GET |
/qr-codes | List all QR codes |
POST |
/qr-codes | Create a new QR code |
GET |
/qr-codes/{id} | Get a specific QR code |
PUT |
/qr-codes/{id} | Update a QR code |
DELETE |
/qr-codes/{id} | Delete a QR code |
GET |
/qr-codes/{id}/image | Download QR code image |
Analytics
| Method | Endpoint | Description |
|---|---|---|
GET |
/analytics/dashboard | Overview metrics |
GET |
/analytics/time-series | Scan trends over time |
GET |
/analytics/geographic | Geographic distribution |
GET |
/analytics/devices | Device breakdown |
GET |
/analytics/top-qr-codes | Most scanned QR codes |
Batch Operations
| Method | Endpoint | Description |
|---|---|---|
POST |
/batch/qr-codes | Create multiple QR codes |
POST |
/batch/qr-codes/generate | Generate batch images |
GET |
/batch/jobs/{id} | Check batch job status |
GET |
/batch/jobs/{id}/download | Download batch results |
Interactive API Documentation
Live API Documentation
Access the full interactive Swagger UI at: /api/docs
The embedded Swagger UI below provides interactive documentation for all API endpoints. You can authenticate and test endpoints directly from this interface.
Code Examples
PHP (Laravel)
<?php
use Illuminate\Support\Facades\Http;
// Get API token
$response = Http::post('https://qr2.ignited.cloud/api/v1/auth/token', [
'email' => 'user@example.com',
'password' => 'password',
]);
$token = $response->json('data.token');
// Create a QR code
$response = Http::withToken($token)
->post('https://qr2.ignited.cloud/api/v1/qr-codes', [
'campaign_id' => 1,
'gtin' => '09506000134352',
'batch_number' => 'BATCH001',
'destination_url' => 'https://example.com/product',
]);
$qrCode = $response->json('data');
JavaScript (Fetch)
// Get API token
const authResponse = await fetch('https://qr2.ignited.cloud/api/v1/auth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'user@example.com',
password: 'password',
}),
});
const { data: { token } } = await authResponse.json();
// Create a QR code
const qrResponse = await fetch('https://qr2.ignited.cloud/api/v1/qr-codes', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
body: JSON.stringify({
campaign_id: 1,
gtin: '09506000134352',
batch_number: 'BATCH001',
destination_url: 'https://example.com/product',
}),
});
const qrCode = await qrResponse.json();
Python (Requests)
import requests
BASE_URL = 'https://qr2.ignited.cloud/api/v1'
# Get API token
auth_response = requests.post(f'{BASE_URL}/auth/token', json={
'email': 'user@example.com',
'password': 'password',
})
token = auth_response.json()['data']['token']
# Create a QR code
headers = {'Authorization': f'Bearer {token}'}
qr_response = requests.post(f'{BASE_URL}/qr-codes', json={
'campaign_id': 1,
'gtin': '09506000134352',
'batch_number': 'BATCH001',
'destination_url': 'https://example.com/product',
}, headers=headers)
qr_code = qr_response.json()['data']
cURL
# Get API token
TOKEN=$(curl -s -X POST https://qr2.ignited.cloud/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "password"}' \
| jq -r '.data.token')
# Create a QR code
curl -X POST https://qr2.ignited.cloud/api/v1/qr-codes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"campaign_id": 1,
"gtin": "09506000134352",
"batch_number": "BATCH001",
"destination_url": "https://example.com/product"
}'