Read an upload
Read an upload started with POST /uploads. Its Location header names this URL.
GET https://sitepaste.com/api/v1/public/uploads/{uploadId}
Requires the media scope.
Read this when an upload fails partway. If your PUT to the upload URL times out, you cannot tell whether the bytes arrived, and status answers it. pending means send them again, uploaded means go straight to the completion.
Usage
curl "https://sitepaste.com/api/v1/public/uploads/$UPLOAD_ID" \
-H "Authorization: Bearer $TOKEN"
Response
200 OK
{
"id": "liuMcQRtmAmMen7IUd6wU9pA",
"type": "direct",
"fileName": "9f2c1ab4d0e77135.png",
"status": "uploaded",
"size": 20481
}
| Field | Meaning |
|---|---|
id | The upload’s id, the same handle you were given |
type | direct for a single PUT, multipart for a parted upload |
fileName | The upload’s name while it is in progress. It is not the media library’s fileId, because completion converts images to WebP and gives the file a new name |
status | pending until the file has been received, uploaded once it has and completion is the next step, completed once the upload has been completed into the media library |
fileId | The media library id of the completed file, for the media routes. Present only when status is completed |
size | Bytes received; absent while pending |
Only a direct upload reads uploaded. A multipart upload reads pending until it reads completed.
A completed upload reads back as:
{
"id": "liuMcQRtmAmMen7IUd6wU9pA",
"type": "direct",
"fileName": "9f2c1ab4d0e77135.png",
"status": "completed",
"fileId": "f8e2a1b3c4d5.webp",
"size": 20481
}
| Code | Meaning |
|---|---|
| 404 | The id is not one this API issued, or names an upload in another workspace. |
| 503 | Storage is unavailable, so the upload’s state cannot be read. Retry later. |