CryptNote

API para integração com mensagens seguras

Idioma: PT EN

A API permite criar links de mensagem segura e recuperá-los programaticamente.

Início Rápido

curl
curl -sS /api/v1/create.php \
  -H 'Content-Type: application/json' \
  -d '{"content":"Olá API","max_views":1}'
JavaScript (fetch)
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();

Base da API

/api/v1

Criar conteúdo criptografado

POST /api/v1/create

Corpo JSON:

  • content (string, obrigatório, máx. 50000)
  • is_markdown (bool, opcional, padrão: false)
  • max_views (int, 1-20, opcional, padrão: 1)
  • password (string, opcional, 4-100)
  • expire_minutes (int, 1-10080, opcional)

Resposta (200):

{
    "success": true,
    "share_url": "https://.../view.php?token=...",
    "token": "..."
}
Com senha e múltiplas visualizações
curl -sS /api/v1/create.php \
  -H 'Content-Type: application/json' \
  -d '{"content":"segredo","password":"Secreta@123","max_views":5}'
Markdown + expiração por tempo
curl -sS /api/v1/create.php \
  -H 'Content-Type: application/json' \
  -d '{"content":"# Título","is_markdown":true,"expire_minutes":60}'

Ler/Descriptografar

POST /api/v1/view

Corpo JSON:

  • token (string, obrigatório)
  • password (string, necessário se protegido)

Resposta (200):

{
  "success": true,
  "content": "... plaintext ...",
  "is_markdown": false,
  "remaining_views": 0,
  "expires_at": null
}
Com senha (exemplo)
curl -sS /api/v1/view.php \
  -H 'Content-Type: application/json' \
  -d '{"token":"TOKEN","password":"Secreta@123"}'
Erro de senha
{
  "success": false,
  "error": "password_required|invalid_token|not_found_or_expired"
}

※ Este endpoint consome uma visualização quando bem-sucedido.

Status do token (não consome visualização)

POST /api/v1/status

Corpo JSON:

  • token (string, obrigatório)

Resposta (200):

{
  "success": true,
  "status": "active|expired|not_found",
  "requires_password": false,
  "is_markdown": false,
  "max_views": 1,
  "remaining_views": 1,
  "expires_at": null
}
Exemplo
curl -sS /api/v1/status.php \
  -H 'Content-Type: application/json' \
  -d '{"token":"TOKEN"}'

Erros comuns

  • content_required — conteúdo vazio
  • invalid_max_views — fora do intervalo 1-20
  • invalid_expire_minutes — fora do intervalo 1-10080
  • password_required — faltando senha
  • not_found_or_expired — token não existe/expirado
Voltar à página inicial