UniMsg Developer Documentation
Documentazione tecnica completa per integrare UniMsg nelle tue applicazioni. API REST, OAuth 2.0, webhook e molto altro.
Base URL:
https://api.unimsg.app
Autenticazione
OAuth 2.0 Client Credentials flow per ottenere access token.
API Reference
Documentazione completa di tutti gli endpoint API.
Webhook
Implementazione webhook con verifica HMAC signature.
SDK & Librerie
SDK ufficiali e librerie per PHP, Python, Node.js.
Quick Start
Ecco un esempio rapido per inviare un SMS:
1. Ottieni un Access Token
curl -X POST https://api.unimsg.app/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=demo_xxxxxxxxxxxx" \
-d "client_secret=sk_test_xxxxxxxxxxxx"
2. Invia un SMS
curl -X POST https://api.unimsg.app/v1/sms/send \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+39123456789",
"message": "Hello from UniMsg API!",
"sender": "UniMsg"
}'
3. Risposta
{
"success": true,
"data": {
"message_id": "msg_xxxxxxxxxxxx",
"status": "queued",
"credits_used": 1
}
}
Endpoint Principali
| Risorsa | Endpoint | Descrizione |
|---|---|---|
| Auth | POST /oauth/token |
Ottieni access token |
| SMS | POST /v1/sms/send |
Invia SMS |
POST /v1/whatsapp/send |
Invia messaggio WhatsApp | |
POST /v1/email/send |
Invia email | |
| Telegram | POST /v1/telegram/send |
Invia messaggio Telegram |
| Messages | GET /v1/messages/{id} |
Stato messaggio |
| Account | GET /v1/account/balance |
Saldo crediti |
Formato Risposte
Tutte le risposte API seguono questo formato:
Successo
{
"success": true,
"data": {
// Response data
}
}
Errore
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human readable error message"
}
}
Versioning
L'API è versionata tramite il path URL. La versione corrente è v1.
https://api.unimsg.app/v1/...
Le versioni deprecate riceveranno supporto per almeno 12 mesi dopo l'annuncio di deprecazione.