Skip to main content

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

ParameterTypeDescription
asset_idstringThe unique identifier of the asset to retrieve.

Request Headers

HeaderTypeDescription
accessTokenstringAccess 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

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true for a successful operation.
dataobjectContains detailed information of the specified asset.

Data Object:

FieldTypeDescription
idstringUnique identifier of the asset.
namestringThe name or title of the asset.
typestringThe type of the asset (e.g., "folder", "image/webp").
parentFolderstringIdentifier of the parent folder, if available.
linkstringURL link to access the asset. (only for files)
keystringKey associated with the asset, typically a path.
sizenumberSize of the asset in bytes.
titlestringTitle of the asset file.
altTextstringAlternative text for the asset.
tagsarrayTags associated with the asset.
assignedProductsarrayList of products assigned to the asset.
assignedCategoriesarrayList of categories assigned to the asset.
createdAtstringTimestamp when the asset was created.
updatedAtstringTimestamp when the asset was last updated.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
404Not Found: The specified asset could not be found.
500Internal 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.