Confirm the File Upload

Confirm the file upload to prevent the file from being deleted after the Time To Live (TTL), and check the file storage information.

Request URL

POST {base_url}/uc-resources/api/v1/system/file/confirm

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code Yes String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
resourceIds Yes Array<Integer> The resource IDs of the uploaded files.
Note: You can obtain the resource IDs using the Upload Files to Public Storage interface.
includeUrl No Boolean Whether to return the file access URL information, including the download URL, file path, endpoint, and bucket.

Valid value:

  • true
  • false (Default)

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Confirm_Result> The confirmation result of the file upload.
Confirm_Result
Parameter Type Description
confirmedItems Array<Confirm_Item> The list of confirmed files.

Confirm_Item

Parameter Type Description
resourceId String The resource ID.
fileName String The original name of the file.
fileSize Integer The size of the file in bytes.
etag String The object version identifier of the file used for file integrity verification.
downloadUrl String The download URL of the file.
filePath String The file path inside the bucket, excluding the bucket host prefix.
endpoint String The host of the access endpoint.
bucket String The name of the bucket.

Example

Request example

POST /uc-resources/api/v1/system/file/confirm HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkaXN0cmlidXRvcmV4YW1wbGVAb3V0bG9vay5jb20iLCJhcHBfa2V5Ijoic2xOdnQzaHc1NXB2Vm5HRlNhR2ZOVTNmMWxYQ3lpa08iLCJncmFudF90eXBlIjoib3BlbmFwaSIsImNsaWVudF9leHQiOnsiZGVzY3JpcHRpb24iOiLnrKzkuInmlrnlkIjkvZzkvJnkvLTlupTnlKgiLCJwYXJ0bmVyIjoi56S65L6L5ZCI5L2c5LyZ5Ly0In0sImNsaWVudF90eXBlIjoib3BlbmFwaSIsImV4cCI6MTc5MTkxMDc4NCwiaWF0IjoxNzkxODg5MTg0LCJqdGkiOiI0MzFjYWQ3OC0wMjhlLTQ3OGEtYTBjOC1iOGVkMjg3OWM3Y2EiLCJjbGllbnRfaWQiOiJub3ZvLW9wZW4tcGxhdGZvcm0iLCJ1c2VyX2V4dCI6eyJyb2xlSWRzIjpbM10sInN0eXBlIjoiQURNSU4iLCJ0ZW5hbnRDb2RlIjpudWxsLCJ0eXBlIjoiUF9BQ0NPVU5UIiwidXNlcklkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJlbWFpbCI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInVzZXJuYW1lIjoiZGlzdHJpYnV0b3JleGFtcGxlQG91dGxvb2suY29tIiwidWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5Nn19.4FJJ47AWqWlT6aF1vACc9iQwKWPemqe7C-VnYTEizL-2umZPs8ThDmsL7H74Cp2HK7JiUU01NepbR26dT-IHsIUaQzPjlpRQqycXI0Na3KIDzJ2bxa4ieosc621khHvy9jSyfJ8L7bcVHdW0Wmafq18L7lyTojfurarraRWoApOhBkcEk_txXZBb5yXDjAwbtwEFagHFZauehP6bMQpVc0vbgedIdlrNKhtxmIw_B522csBI9z6Ax_1uhRW__G8zuFP0lsBhga-SJmqdXOCU1pdZ6CeU6_VINujpn_WGHPTTNrTX1JK4wnP-oUVmPjCPNbyg9V4Wp2c11ahSHbq_Xw
Content-Type: application/json
x-tenant-code: jint
{
  "resourceIds": [2109962287675691010],
  "includeUrl": true
}

Response example

HTTP/1.1 200 OK
{
    "result": {
        "confirmedItems": [
            {
                "resourceId": "2116051080461225986",
                "fileName": "Wallpaper.png",
                "fileSize": 186271,
                "etag": "\"69f4b5a60778557b84d2fcf59db1d441\"",
                "downloadUrl": "https://novo-one-tst-self-operated-business.s3.ap-east-1.amazonaws.com/public/platform/3076913644890832896/auto_phone/Wallpaper.png",
                "filePath": "public/platform/3076913644890832896/auto_phone/Wallpaper.png",
                "endpoint": "https://s3.ap-east-1.amazonaws.com",
                "bucket": "novo-one-tst-self-operated-business"
            }
        ]
    },
    "requestId": "003582fe14e4c781ab272d3c4a92b7f0",
    "code": "200",
    "message": "SUCCESS"
}