response.upload.url using the method specified by response.upload.method. After the upload succeeds, use response.resource_url as the relevant entry in resources when creating an analysis task.Always check meta.code:0indicates business success. The upload policy remains valid for the number of seconds specified byttl; request a new policy after it expires. Do not save or submit the temporary signedupload.urlas the resource URL.
| Field | Type | Required | Description |
|---|---|---|---|
file_name | string | Conditional | Original file name, for example front.jpg. It is used to determine the file type and allocate a resource identifier; do not pass a client-side directory path. |
suffix | string | Conditional | File extension without the leading dot, for example jpg. When only this field is provided, the service generates a file name. |
file_name and suffix. If only file_name is supplied, its extension is used. ZIP files are currently not supported.| Field | Type | Description |
|---|---|---|
meta.code | integer | Business status code. 0 indicates success. |
meta.msg | string | Business message. |
meta.error | string | Error details; empty on success. |
meta.req_id | string | Request identifier for troubleshooting. |
meta.request_uri | string | Current request path. |
response.resource_key | string | Allocated file resource identifier. |
response.resource_url | string | Resource URL to use after the upload succeeds. Submit this URL when creating an analysis task. |
response.ttl | integer | Upload policy validity period in seconds. |
response.upload.method | string | Upload method. The current values are PUT and POST. |
response.upload.url | string | Destination for this upload; use it only while the policy is valid. |
response.upload.form_data | object | Form fields that must be sent unchanged for a POST multipart/form-data upload. |
response.provider | string | Upload service identifier, when returned. |
response.token | string | Upload credential, when returned. |
response.hosts | object | Available upload host information, when returned. |
response.mime | string | File MIME type, when returned. |
meta.code = 0.response.upload.method; clients must not assume a single upload method.response.ttl expires.response.resource_url.resources.PUT uploadPOST multipart/form-data uploadresponse.upload.form_data to the form unchanged, then add the file itself as a form field named file. Example:{
"api_code": "online_skin",
"algorithm_variant": "standard",
"resources": {
"front_image": "https://storage.example.com/files/6d83a0f1-front.jpg"
}
}meta.code | Meaning | Resolution |
|---|---|---|
44007 | File name is missing | Provide file_name or suffix. |
44008 | The file extension cannot be determined | Provide suffix, or supply file_name with an extension. |
44053 | Unsupported file type | Use a supported file type. ZIP is currently not supported. |
44098 | Invalid merchant information | Check the calling credential and merchant configuration. |
44099 | The request region does not match the merchant region | Retry through the API base URL for the merchant's region. |
curl --location 'https://gapi.evelabinsight.com/skin_api/file/upload_policy' \
--header 'Access-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"file_name": "front.jpg"
}'upload.url, then retain resource_url.{
"meta": {
"code": 0,
"msg": "",
"error": "",
"req_id": "4826bbfa2ab1db905e6ac2909682746a",
"request_uri": "/skin_api/file/upload_policy"
},
"response": {
"resource_key": "6d83a0f1-1f6c-4e1a-a5ba-3fb8f4fb8350.jpg",
"resource_url": "https://storage.example.com/files/6d83a0f1-1f6c-4e1a-a5ba-3fb8f4fb8350.jpg",
"ttl": 3600,
"upload": {
"method": "PUT",
"url": "https://storage.example.com/files/6d83a0f1-1f6c-4e1a-a5ba-3fb8f4fb8350.jpg?temporary-signature=REDACTED"
}
}
}