QRdex
Manage QR codes via the QRdex.io REST API.
Setup
Set the API key as an environment variable:
CODEBLOCK0
Get a key from: QRdex.io → Team Settings → API section.
API access requires Growth plan or above.
Quick Reference
Base URL: INLINECODE0
All requests require Authorization: Bearer $QRDEX_API_KEY and Content-Type: application/json.
Create a QR Code
CODEBLOCK1
QR Types and Required Fields
| Type | Required Fields |
|---|
| INLINECODE3 | INLINECODE4 |
| INLINECODE5 |
email_address (optional:
email_subject,
message) |
|
telephone |
telephone_number |
|
sms |
telephone_number (optional:
message) |
|
whatsapp |
telephone_number (optional:
message) |
|
wifi |
wifi_ssid (optional:
wifi_encryption,
wifi_password,
wifi_hidden) |
Common Optional Fields
- -
foreground_color — hex color (default: #000000) - INLINECODE24 — hex color (default:
#FFFFFF) - INLINECODE26 — QR code shape (default:
rounded) - INLINECODE28 — enable scan tracking (default:
true)
List QR Codes
CODEBLOCK2
Query params: page, per_page (max 100), qr_type filter.
Get / Update / Delete
CODEBLOCK3
Download QR Image (SVG)
CODEBLOCK4
Returns image/svg+xml. Use the image_url field from any QR code response directly in <img> tags.
Using the Python Script
For programmatic use, use scripts/qrdex_api.py:
CODEBLOCK5
Error Handling
- -
401 — Invalid/missing API key - INLINECODE38 — No permission
- INLINECODE39 — QR code not found or belongs to different team
- INLINECODE40 — Validation error or plan limit reached
- INLINECODE41 — Rate limited (100 req/min per key). Check
X-RateLimit-Remaining header.
API Reference
For full field descriptions and response schemas, see references/API_REFERENCE.md.
QRdex
通过QRdex.io REST API管理二维码。
设置
将API密钥设置为环境变量:
bash
export QRDEXAPIKEY=your-api-key
从以下位置获取密钥:QRdex.io → 团队设置 → API部分。
API访问需要Growth计划或更高级别。
快速参考
基础URL:https://qrdex.io/api/v1
所有请求都需要Authorization: Bearer $QRDEXAPIKEY和Content-Type: application/json。
创建二维码
bash
curl -X POST https://qrdex.io/api/v1/qr_codes \
-H Authorization: Bearer $QRDEXAPIKEY \
-H Content-Type: application/json \
-d {
qr_code: {
title: 我的网站,
qr_type: url,
url: https://example.com
}
}
二维码类型及必填字段
email
address(可选:emailsubject、message) |
| telephone | telephone_number |
| sms | telephone_number(可选:message) |
| whatsapp | telephone_number(可选:message) |
| wifi | wifi
ssid(可选:wifiencryption、wifi
password、wifihidden) |
常用可选字段
- - foregroundcolor — 十六进制颜色(默认:#000000)
- backgroundcolor — 十六进制颜色(默认:#FFFFFF)
- shape — 二维码形状(默认:rounded)
- track_scans — 启用扫描追踪(默认:true)
列出二维码
bash
curl https://qrdex.io/api/v1/qr_codes \
-H Authorization: Bearer $QRDEXAPIKEY
查询参数:page、perpage(最大100)、qrtype筛选。
获取 / 更新 / 删除
bash
获取
curl https://qrdex.io/api/v1/qr
codes/:id -H Authorization: Bearer $QRDEXAPI_KEY
更新(部分更新——仅发送更改的字段)
curl -X PATCH https://qrdex.io/api/v1/qr_codes/:id \
-H Authorization: Bearer $QRDEX
APIKEY \
-H Content-Type: application/json \
-d {qr_code: {title: 新标题}}
删除(软删除)
curl -X DELETE https://qrdex.io/api/v1/qr
codes/:id -H Authorization: Bearer $QRDEXAPI_KEY
下载二维码图片(SVG格式)
bash
curl https://qrdex.io/api/v1/qr_codes/:id/image \
-H Authorization: Bearer $QRDEXAPIKEY -o qr.svg
返回image/svg+xml格式。可直接在
标签中使用任何二维码响应中的image_url字段。
使用Python脚本
如需编程使用,请使用scripts/qrdex_api.py:
bash
设置API密钥
export QRDEX
APIKEY=your-key
列出二维码
python scripts/qrdex_api.py list
创建二维码
python scripts/qrdex_api.py create --title 我的网站 --type url --url https://example.com
python scripts/qrdex_api.py create --title WiFi --type wifi --ssid Guest --wifi-password pass123
python scripts/qrdex_api.py create --title 邮箱 --type email --email hi@example.com
python scripts/qrdex_api.py create --title 聊天 --type whatsapp --phone +15551234567 --message 你好!
获取详情
python scripts/qrdex_api.py get 123
更新
python scripts/qrdex_api.py update 123 --title 更新后的标题 --fg-color #FF0000
删除
python scripts/qrdex_api.py delete 123
下载图片
python scripts/qrdex_api.py image 123 -o qr.svg
错误处理
- - 401 — API密钥无效或缺失
- 403 — 无权限
- 404 — 二维码未找到或属于不同团队
- 422 — 验证错误或达到计划限制
- 429 — 请求频率受限(每个密钥每分钟100次请求)。请检查X-RateLimit-Remaining响应头。
API参考
有关完整的字段描述和响应模式,请参阅references/API_REFERENCE.md。