Naar inhoud springen
API-referentie
API-referentie

Het saldo ophalen

Het resterende betaalde en bonussaldo plus de huidige gebruikstotalen ophalen.

Het resterende betaalde en bonussaldo plus de huidige gebruikstotalen ophalen.

Eindpunt

GET /api/v1/me/balance
Basis-URL
https://runapi.ai
API-versie
v1
Authenticatie
Authorization: Bearer YOUR_API_KEY
Autorisatie
Retourneert het saldo voor het account dat gekoppeld is aan de gepresenteerde standaard API-sleutel.
02

Succesvol antwoord

HTTP 200

GET /api/v1/me/balance

JSON
{
  "balance_cents": 1200,
  "bonus_balance_cents": 200,
  "paid_balance_cents": 1000,
  "spent_cents_today": 75,
  "spent_cents_total": 4300
}
03

Foutrespons (401)

HTTP 401
Responsschema
JSON
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Responsvoorbeeld

JSON
{
  "error": "Authentication required"
}
04

Foutrespons (403)

HTTP 403
Responsschema
JSON
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Responsvoorbeeld

JSON
{
  "error": "Standard API key required"
}
05

cURL-voorbeeld

CURL
curl -X GET https://runapi.ai/api/v1/me/balance \
  -H 'Authorization: Bearer YOUR_API_KEY'