Account

Saldo e stime dei costi

GET/v1/balance

Il saldo attuale in USD.

curl https://bulksmsapi.cc/v1/balance \
  -H "Authorization: Bearer $BULKSMSAPI_KEY"
200 OKJSON
{
  "object": "balance",
  "balance": "184.32950",
  "currency": "USD"
}

Stime

POST/v1/estimates

Prende lo stesso corpo di POST /v1/batches e restituisce quanto costerebbe. Non viene inviato nulla e non viene addebitato nulla.

curl https://bulksmsapi.cc/v1/estimates \
  -H "Authorization: Bearer $BULKSMSAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Doors open at 18:00 tonight.", "to": ["+14155550123", "+447400123456", "+447400123456", "12"]}'
200 OKJSON
{
  "object": "estimate",
  "recipients": 2,
  "set_aside": [
    { "to": "+447400123456", "reason": "duplicate" },
    { "to": "12", "reason": "invalid_number" }
  ],
  "encoding": "GSM-7",
  "segments": 2,
  "max_segments": 1,
  "cost": "0.01294",
  "currency": "USD",
  "by_country": [
    { "country": "US", "recipients": 1, "segments": 1, "cost": "0.00507" },
    { "country": "GB", "recipients": 1, "segments": 1, "cost": "0.00787" }
  ]
}

In esaurimento

Una richiesta che costa più del saldo risponde 402 top_up_required con entrambi gli importi nel messaggio, e non viene inviato nulla. Controlla il saldo prima di un batch grande, o stima prima, e ricarica nella console.

Saldo e stime dei costi | Documentazione BulkSMSAPI