curl --request GET \
--url https://jmpy.me/api/v1/qr-codes/{id} \
--header 'Authorization: Bearer <token>'{
"success": true,
"data": {
"qrCode": {
"id": "<string>",
"user_id": "<string>",
"name": "<string>",
"content_type": "<string>",
"content_data": {},
"visual_settings": {},
"is_dynamic": true,
"tracking_enabled": true,
"short_url_id": "<string>",
"scan_count": 123,
"last_scanned_at": "<string>",
"expires_at": "<string>",
"is_password_protected": true,
"source": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
}Retrieve a specific QR code by ID
curl --request GET \
--url https://jmpy.me/api/v1/qr-codes/{id} \
--header 'Authorization: Bearer <token>'{
"success": true,
"data": {
"qrCode": {
"id": "<string>",
"user_id": "<string>",
"name": "<string>",
"content_type": "<string>",
"content_data": {},
"visual_settings": {},
"is_dynamic": true,
"tracking_enabled": true,
"short_url_id": "<string>",
"scan_count": 123,
"last_scanned_at": "<string>",
"expires_at": "<string>",
"is_password_protected": true,
"source": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
}temp-) cannot be retrieved. Only saved QR codes from authenticated users can be accessed.Show QR Code Object
Show QR Code Properties
url, text, wifi, vcard, email, phone, sms, location.QR_CODE_GENERATOR, BULK_IMPORT, etc.curl -X GET "https://jmpy.me/api/v1/qr-codes/770e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY"
const fetch = require('node-fetch');
const qrCodeId = '770e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://jmpy.me/api/v1/qr-codes/${qrCodeId}`,
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
if (data.success) {
const qrCode = data.data.qrCode;
console.log('QR Code Name:', qrCode.name);
console.log('Content Type:', qrCode.content_type);
console.log('Scans:', qrCode.scan_count);
}
import axios from 'axios';
interface QRCodeResponse {
success: boolean;
data: {
qrCode: {
id: string;
name: string;
content_type: string;
content_data: Record<string, any>;
is_dynamic: boolean;
tracking_enabled: boolean;
scan_count: number;
visual_settings: Record<string, any>;
created_at: string;
updated_at: string;
};
};
}
const qrCodeId = '770e8400-e29b-41d4-a716-446655440000';
const response = await axios.get<QRCodeResponse>(
`https://jmpy.me/api/v1/qr-codes/${qrCodeId}`,
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
console.log('QR Code:', response.data.data.qrCode);
import requests
qr_code_id = '770e8400-e29b-41d4-a716-446655440000'
response = requests.get(
f'https://jmpy.me/api/v1/qr-codes/{qr_code_id}',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
if data['success']:
qr_code = data['data']['qrCode']
print(f"Name: {qr_code['name']}")
print(f"Type: {qr_code['content_type']}")
print(f"Scans: {qr_code.get('scan_count', 0)}")
print(f"Is Dynamic: {qr_code['is_dynamic']}")
<?php
$client = new GuzzleHttp\Client();
$qrCodeId = '770e8400-e29b-41d4-a716-446655440000';
$response = $client->request('GET', "https://jmpy.me/api/v1/qr-codes/{$qrCodeId}", [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
$qrCode = $data['data']['qrCode'];
echo "Name: " . $qrCode['name'] . "\n";
echo "Scans: " . $qrCode['scan_count'] . "\n";
?>
package main
import (
"fmt"
"net/http"
)
func main() {
qrCodeId := "770e8400-e29b-41d4-a716-446655440000"
url := fmt.Sprintf("https://jmpy.me/api/v1/qr-codes/%s", qrCodeId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
fmt.Println("Response status:", resp.Status)
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.URI;
import java.net.http.HttpResponse;
String qrCodeId = "770e8400-e29b-41d4-a716-446655440000";
String url = "https://jmpy.me/api/v1/qr-codes/" + qrCodeId;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer YOUR_API_KEY")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"success": true,
"data": {
"qrCode": {
"id": "770e8400-e29b-41d4-a716-446655440000",
"user_id": "user-uuid-here",
"name": "Product Launch QR",
"content_type": "url",
"content_data": {
"url": "https://example.com/product"
},
"visual_settings": {
"foregroundColor": "#1a1a1a",
"backgroundColor": "#ffffff",
"size": 400,
"errorCorrectionLevel": "H"
},
"is_dynamic": true,
"tracking_enabled": true,
"short_url_id": "550e8400-e29b-41d4-a716-446655440000",
"scan_count": 523,
"last_scanned_at": "2024-01-20T14:22:00.000Z",
"expires_at": null,
"is_password_protected": false,
"source": "QR_CODE_GENERATOR",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-20T14:22:00.000Z"
}
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "QR code not found"
}
}
{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Invalid QR code ID format. Please provide a valid UUID."
}
}
{
"success": false,
"error": {
"code": "ACCESS_DENIED",
"message": "You do not have permission to access this resource"
}
}
{
"success": false,
"error": {
"code": "RESOURCE_EXPIRED",
"message": "QR code has expired"
}
}
Check QR code status before updating
async function safeUpdateQRCode(qrCodeId, newUrl) {
// First, get the QR code details
const response = await fetch(
`https://jmpy.me/api/v1/qr-codes/${qrCodeId}`,
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
if (!data.success) {
throw new Error(data.error.message);
}
const qrCode = data.data.qrCode;
if (!qrCode.is_dynamic) {
throw new Error('Cannot update static QR codes. Create a new one instead.');
}
// Proceed with update...
// See Update QR Code endpoint
}
Display QR code with scan statistics
import requests
from datetime import datetime
def get_qr_code_stats(qr_code_id):
response = requests.get(
f'https://jmpy.me/api/v1/qr-codes/{qr_code_id}',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
if data['success']:
qr = data['data']['qrCode']
print(f"π QR Code: {qr['name']}")
print(f" Type: {'Dynamic' if qr['is_dynamic'] else 'Static'}")
print(f" Total Scans: {qr.get('scan_count', 0)}")
if qr.get('last_scanned_at'):
last_scan = datetime.fromisoformat(qr['last_scanned_at'].replace('Z', '+00:00'))
print(f" Last Scanned: {last_scan.strftime('%Y-%m-%d %H:%M')}")
if qr.get('expires_at'):
print(f" Expires: {qr['expires_at']}")
return qr
else:
print(f"Error: {data['error']['message']}")
return None