Berkas & batch

Mengambil Batch

Mengambil status saat ini, jumlah, dan file hasil untuk sebuah batch.

GET
/v1/batches/{batch_id}

Gambaran Umum

Mengembalikan status batch, jumlah yang selesai dan gagal, serta ID file hasil.

Contoh

Permintaan

cURL
curl -X GET "https://api.tokenlab.sh/v1/batches/batch_abc123" \
  -H "Authorization: Bearer sk-your-api-key"

Contoh respons

Respons

200 OK
{
  "id": "batch_abc123",
  "object": "batch",
  "status": "completed",
  "input_file_id": "file_abc123",
  "output_file_id": "file_out123",
  "error_file_id": "file_err123",
  "request_counts": { "total": 100, "completed": 98, "failed": 2 }
}

Bidang penting

request_countsobject
Jumlah total, selesai, gagal, dan permintaan yang dibatalkan.
output_file_idstring|null
ID file hasil yang berhasil.
error_file_idstring|null
ID file hasil yang gagal.

Otorisasi

BearerAuth
AuthorizationBearer <token>

Autentikasi API Key. Buat atau kelola API key di Dashboard > API > API Keys.

Lokasi: header

Parameter path

batch_id*string

Respons

application/json

application/json