Generate presigned URLs for multimedia resources
Description
Use this API to generate a temporary, secure presigned URL for media resources, such as audio, video, and images, stored in the AI Search Platform by providing the dataset ID and the primary key of a data record. The URL can be used directly for front-end display or for download.
Primary use case
When you use the Search API with an application created in the AI Search Platform, the URLs for images, audio, and video in the search results are presigned URLs. These URLs are valid for 24 hours.
If your application stores these URLs, they become invalid when they expire. To generate a new, valid presigned URL, call this API with the corresponding dataset ID and primary key.
Request parameters
Parameter | Type | Description |
body | object | The request body. Example:
|
datasetId | string | The dataset ID. You can find this ID in the Dataset List in the console. Example: |
primaryKey | string | The primary key of the data record in the dataset. Example: |
Response parameters
Parameter | Type | Description |
code | integer<int32> | The business status code. A value of Example: |
message | string | Returns Example: |
data | object | The data payload of the response. |
url | string | An OSS presigned URL that includes a signature and an expiration time. The URL is valid for 24 hours and can be used directly for display or download. Example: |
requestId | string | The unique request ID. You can use this ID to troubleshoot issues. Example: |
Response example
{
"code": 200,
"message": "success",
"data": {
"url": "https://maas-ai-search-center-raw.oss-cn-hangzhou.aliyuncs.com/.../sample.mp4..."
},
"requestId": "1a0f40da17774667074596639ec2b6"
}Error codes
Error code | Message | Description | Recommended action |
400 | datasetId: must not be null | The request parameters are incomplete or incorrectly formatted. For example, the required | Check your request to ensure that all required parameters are provided and correctly formatted. |
403 | Access denied | Access is denied, typically due to failed authentication or insufficient permissions. | Verify that your Access Key and other authentication credentials are correct, and that you have the necessary permissions to perform the operation. |
404 | Dataset not found | The specified dataset does not exist. | Check whether the |
404 | Resource not found | No record with the specified primary key exists in the target dataset. | Check that the |
404 | Resource file not found | A record with the specified primary key exists, but its associated file is missing. This can occur if the | Verify that the specified file is stored correctly and is accessible. |
500 | Internal server error | An unknown internal server error occurred. | Try the request again later. If the problem persists, contact technical support. |