API for integrating secure messages
The API lets you create secure message links and retrieve them programmatically.
curl -sS /api/v1/create.php \
-H 'Content-Type: application/json' \
-d '{"content":"Olá API","max_views":1}'
const res = await fetch('/api/v1/create.php', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({content: 'Olá API', max_views: 1})
});
const json = await res.json();
POST /api/v1/create
JSON body:
content (string, required, max 50000)is_markdown (bool, optional, default: false)max_views (int, 1-20, optional, default: 1)password (string, optional, 4-100)expire_minutes (int, 1-10080, optional)Response (200):
{
"success": true,
"share_url": "https://.../view.php?token=...",
"token": "..."
}
curl -sS /api/v1/create.php \
-H 'Content-Type: application/json' \
-d '{"content":"segredo","password":"Secreta@123","max_views":5}'
curl -sS /api/v1/create.php \
-H 'Content-Type: application/json' \
-d '{"content":"# Título","is_markdown":true,"expire_minutes":60}'
POST /api/v1/view
JSON body:
token (string, required)password (string, required if protected)Response (200):
{
"success": true,
"content": "... plaintext ...",
"is_markdown": false,
"remaining_views": 0,
"expires_at": null
}
curl -sS /api/v1/view.php \
-H 'Content-Type: application/json' \
-d '{"token":"TOKEN","password":"Secreta@123"}'
{
"success": false,
"error": "password_required|invalid_token|not_found_or_expired"
}
※ This endpoint consumes one view when successful.
POST /api/v1/status
JSON body:
token (string, required)Response (200):
{
"success": true,
"status": "active|expired|not_found",
"requires_password": false,
"is_markdown": false,
"max_views": 1,
"remaining_views": 1,
"expires_at": null
}
curl -sS /api/v1/status.php \
-H 'Content-Type: application/json' \
-d '{"token":"TOKEN"}'
content_required — empty contentinvalid_max_views — out of 1-20 rangeinvalid_expire_minutes — out of 1-10080 rangepassword_required — missing passwordnot_found_or_expired — token not found/expired