Get Asset by ID
The GET endpoint retrieves details of a specific asset identified by asset_id.
Endpoint
- URL:
/asset/{asset_id} - Method:
GET
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
asset_id | string | The unique identifier of the asset to retrieve. |
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"data": {
"_id": "664f1e685ef340dfe52581ea",
"name": "/",
"type": "folder",
"parentFolder": null,
"size": 54351317,
"tags": [],
"assignedProducts": [],
"assignedCategories": [],
"createdAt": "2024-05-23T10:46:00.260Z",
"updatedAt": "2024-09-06T14:06:10.817Z",
"id": "664f1e685ef340dfe52581ea"
}
}
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request, typically true for a successful operation. |
data | object | Contains detailed information of the specified asset. |
Data Object:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the asset. |
name | string | The name or title of the asset. |
type | string | The type of the asset (e.g., "folder", "image/webp"). |
parentFolder | string | Identifier of the parent folder, if available. |
link | string | URL link to access the asset. (only for files) |
key | string | Key associated with the asset, typically a path. |
size | number | Size of the asset in bytes. |
title | string | Title of the asset file. |
altText | string | Alternative text for the asset. |
tags | array | Tags associated with the asset. |
assignedProducts | array | List of products assigned to the asset. |
assignedCategories | array | List of categories assigned to the asset. |
createdAt | string | Timestamp when the asset was created. |
updatedAt | string | Timestamp when the asset was last updated. |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 404 | Not Found: The specified asset could not be found. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure you replace
{asset_id}in the URL with the actual unique identifier of the asset being retrieved. - Provide a valid and active access token in the request header to authenticate your request.