Konto

Guthaben und Kostenschätzungen

GET/v1/balance

Das aktuelle Guthaben in USD.

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

Schätzungen

POST/v1/estimates

Nimmt den gleichen Body wie POST /v1/batches und gibt zurück, was es kosten würde. Nichts wird gesendet und nichts wird berechnet.

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" }
  ]
}

Geringes Guthaben

Eine Anfrage, die mehr kostet als das Guthaben, antwortet mit 402 top_up_required und beiden Beträgen in der Nachricht, und nichts wird gesendet. Überprüfen Sie das Guthaben vor einem großen Batch oder schätzen Sie zuerst und laden Sie in der Konsole auf.

Guthaben und Kostenschätzungen | BulkSMSAPI Dokumentation