PIMS Digital Asset Management API
POST/pim/manage/assets
- Requires Data Editor ApiKey permissions.
- Example URI: https://instancename.piminto.com/api/en-us/pim/manage/assets
The assets API in PIMS offers a versatile set of tools for managing digital resources. It facilitates the generation of unique asset codes, retrieval and update of asset metadata, movement of assets between buckets, and fetching asset streams in various sizes.
To use this API, send a POST request with a JSON body.✔The description of JSON keys is provided in the Example Value and Schema sections. Set the action key in the JSON body to one of the following values:
generateAssetCode: Generate Unique Asset Code.Method for obtaining a unique asset code used for managing associated data and resource upload.
updateAssetData: Update Asset Metadata. Method for updating asset metadata based on its unique code.
getAssetData: Get Asset Metadata. Method for retrieving asset metadata based on its unique code.
getAssetDataList: Get List Asset Metadata. Method for retrieving metadata for a list of specified unique asset codes, along with 'invalid_codes': a list of asset codes not found in the repository
deleteAsset: Delete Asset. Removes the asset from the repository if it is not linked to any products. If the optional force_unlink parameter is true when deleting an asset, its link to all products in which it is used will be broken. Note: The data in the product associated with the asset will be deleted.
Asset Loading and Retrieval API
For LOAD or UPDATE an Asset: POST https://instancename.piminto.com/api/a/AssetCode/
Ensure the Asset file is included in the request body for a successful operation.
For RETRIEVING an Asset: GET https://instancename.piminto.com/api/a/AssetCode/ or GET https://instancename.piminto.com/api/a/AssetCode/file.extension
Request
- application/json
Body
required
- Generate Unique Asset Code
- Update Asset Metadata
- Get Asset Metadata
- Get List Asset Metadata
- Delete Asset
Possible values: [generateAssetCode
]
Possible values: [updateAssetData
]
Asset code.
data objectrequired
Metadata. Extendable.
The URL pointing to the Asset, facilitating direct access to the resource.
Possible values: [application
, audio
, example
, image
, message
, model
, multipart
, text
, video
]
This signifies the nature of the transmitted data, adhering to the MIME standard.
The Asset file name with extension
Possible values: [getAssetData
]
Asset code.
Possible values: [getAssetDataList
]
Asset codes.
Possible values: [deleteAsset
]
Asset code.
Possible values: [true
, false
]
When set to true, this parameter allows the asset to be removed and its association with all products. Note: Data in the product related to this asset will be deleted.
Responses
- 200
- default
success
- application/json
- Schema
- Example (from schema)
- Generate Unique Asset Code, Delete Asset
- Update Asset Metadata, Get Asset Metadata
- Get List Asset Metadata
Schema
- Generate Unique Asset Code, Delete Asset
- Update Asset Metadata, Get Asset Metadata
- Get List Asset Metadata
- Array [
- ]
data objectrequired
Metadata. Extendable.
assets object[]required
data object
Metadata. Extendable.
{}
{
"status": "OK",
"asset_code": "fe34e84xxxxxxxxxxxxxxxxxxxxxxxxx"
}
{
"status": "OK",
"asset_code": "fe34e84xxxxxxxxxxxxxxxxxxxxxxxxx",
"data": {
"url": "https://instancename.piminto.com/api/a/fe34e84xxxxxxxxxxxxxxxxxxxxxxxxx/image.png",
"filename": "image.png",
"type": "image",
"tags": [
"tag1",
"tag2",
"tag3"
],
"keywords": [
"keyword1",
"keyword2",
"keyword3"
],
"description": "A generic assets description with some key features",
"size": "3224"
}
}
{
"status": "OK",
"assets": [
{
"asset": "fe34e84xxxxxxxxxxxxxxxxxxxxxxxxx",
"data": {
"url": "https://instancename.piminto.com/api/a/fe34e84xxxxxxxxxxxxxxxxxxxxxxxxx/image.png",
"filename": "image.png",
"type": "image",
"tags": [
"tag1",
"tag2",
"tag3"
],
"keywords": [
"keyword1",
"keyword2",
"keyword3"
],
"description": "A generic assets description with some key features",
"size": "3224"
}
}
],
"invalid_codes": [
"ce25xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}
If there is an error with the API request, additional information will be provided in the response body.
Examples of error messages include:
- deleteAsset: If the Asset Code is associated with PIMS product(s) and force_unlink is not set to true:
"status_message": "Asset is used by SKU(s): SKU-TEST"
- application/json
- Schema
- Example (from schema)
- Example
Schema
Possible values: [Error
]
The status of the API request. A value of "Error" indicates that the request was not successfully sent or processed.
Provides a message that describes the reason for the error that occurred while processing the API request.
{
"status": "Error",
"status_message": "string"
}
{
"value": {
"status": "Error",
"status_message": "Invalid asset code: ce25xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}