Get File by ID
GET
https://api.cargopanel.co/v1/files/id/:idGET
https://sandbox-api.cargopanel.co/v1/files/id/:idRetrieves 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
idrequiredstringThe 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
idstringUnique numeric identifier of the file.
originalNamestringThe original name of the file uploaded by the user.
fileNamestringSigned, non-guessable file name. Use it with GET /files/:filename to download the file.
urlstringPublic gateway proxy API URL to view or download the file.
userIdstringAssociated user ID.
shipmentIdstringAssociated shipment ID.
documentTypestringAssociated document classification type.
Responses
200File metadata retrieved successfully
401Missing or invalid token
404File not found or not owned by the API user