# Poll a queued label batch

`GET /v2/file-history?id=88213`

**Base URLs:**

- Sandbox: `https://api.sandbox.bobgo.co.za`
- Production: `https://api.bobgo.co.za`

**Authentication:** Bearer token required (see the Authentication page).

## Example request

```bash
curl -X GET 'https://api.sandbox.bobgo.co.za/v2/file-history?id=88213' \
  -H "Authorization: Bearer <API_KEY>"
```

Reads one generated-file record. You need this when
[`GET /v2/shipments/waybill`](shipment_waybill.md) or
[`GET /v2/shipments/sticker-waybill`](shipment_sticker_waybill.md) answers with
`pdf_queued: true`: the PDF is being built in the background and this is where
the finished file appears.

Any request for more than one shipment is queued, so on a batch print this is
part of the normal path rather than an edge case.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | integer | yes | The `file_history_id` from the label response. An id that is not on your account fails with `No file history found.` |

## Response

```json
{
  "file_history": [
    {
      "id": 88213,
      "account_id": 1234,
      "file_type": "pdf-waybills",
      "file_status": "success",
      "file_url": "https://...",
      "failed_reason": null,
      "time_created": "2026-09-05T08:31:12Z",
      "metadata": {
        "object_reference": null,
        "object_id": null,
        "sent_by_email": false,
        "has_multiple": true
      }
    }
  ],
  "count": 1
}
```

| Field | Notes |
| --- | --- |
| `file_status` | `processing`, `success` or `failed`. |
| `file_url` | The finished document, once `file_status` is `success`. Null before that. The link works for 24 hours. |
| `failed_reason` | Why generation failed. |
| `file_type` | `pdf-waybills` for A4/A5/A6 waybills, `pdf-sticker-waybills` for stickers. |
| `metadata.has_multiple` | True when the file covers more than one shipment. |
| `metadata.sent_by_email` | Always false for an API key. It is only set when a file asked for from the Bob Go app takes more than a minute, and is emailed instead. |

Poll every few seconds until `file_status` leaves `processing`. A batch of
several hundred labels takes appreciably longer than a handful, so back off
rather than polling tightly. Records are kept for a month, so collect the file
when it is ready rather than keeping the id for later.
