Skip to main content

Get All Assets

The GET endpoint retrieves all assets available in the system.

Endpoint

  • URL: /asset/all
  • Method: GET

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

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"
},
{
"_id": "66acca92536e993c9a3aac2f",
"name": "Arun",
"type": "image/webp",
"parentFolder": "664f1e685ef340dfe52581ea",
"link": "https://cdn.mydckapcommerce.com/663a0afe4587085935a4f9dc/image/chat_1722600080844.webp",
"key": "663a0afe4587085935a4f9dc/image/chat_1722600080844.webp",
"size": 220273,
"title": "chat.png",
"altText": "chat.png",
"tags": [],
"assignedProducts": [],
"assignedCategories": [],
"createdAt": "2024-08-02T12:01:22.419Z",
"updatedAt": "2024-08-03T05:10:08.732Z",
"id": "66acca92536e993c9a3aac2f"
}
// Additional asset items...
],
"pagination": {
"count": 10,
"asset": 1,
"total": 29
}
}

Success Response Fields

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true.
dataarrayA list of asset objects. Each object contains detailed asset info.
paginationobjectContains pagination details of the retrieved assets.

Data Array

Each item in the data array represents an asset and can include the following fields:

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.
idstringDuplicate of _id, unique identifier.

Pagination Object:

FieldTypeDescription
countintNumber of assets in the response.
pageintCurrent asset page number.
totalintTotal number of available assets.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal Server Error: An error occurred on the server.

Notes

  • Ensure you provide a valid and active access token in the request header to authenticate your request.
  • The response includes pagination details for handling large datasets.