cargopanel logocargopanel for developers

Get File by ID

GEThttps://api.cargopanel.co/v1/files/id/:id
GEThttps://sandbox-api.cargopanel.co/v1/files/id/:id

Retrieves the metadata of a specific file by its identifier. Requires an API token with the shipment:read scope; only files owned by the authenticated API user can be retrieved, and files of other accounts return 404.

Request Fields

idrequiredstring

The numeric identifier of the file (e.g. 48213907).

Example Response

200
{
  "originalName": "invoice.pdf",
  "fileName": "48213907Xk3fP9qLmZ2vQa",
  "url": "https://api.cargopanel.co/v1/files/48213907Xk3fP9qLmZ2vQa",
  "path": "/files/48213907Xk3fP9qLmZ2vQa",
  "id": "48213907",
  "userId": "usr_xyz789",
  "shipmentId": "12345678",
  "documentType": "invoice"
}

Response Fields

idstring

Unique numeric identifier of the file.

originalNamestring

The original name of the file uploaded by the user.

fileNamestring

Signed, non-guessable file name. Use it with GET /files/:filename to download the file.

urlstring

Public gateway proxy API URL to view or download the file.

userIdstring

Associated user ID.

shipmentIdstring

Associated shipment ID.

documentTypestring

Associated document classification type.

Responses

200File metadata retrieved successfully
401Missing or invalid token
404File not found or not owned by the API user