GET/POST http://yourserver.com/services/asset/history ?id=<assetId> &start=<first result> &num=<max result hits to return> &detailLevel=<level of detail to return> &actions=<comma-delimited actions> |
What does it do?
Returns history details of an asset.
The REST retrieve history method gives insight into what happened to the asset while stored in Assets Server. Ranging from versions created to metadata changes and move actions.
Log in requirement
Before being able to request information from Assets Server by using a GET request or make changes to the system through a POST request, a log in to Assets Server is required. For information about the available APIs for logging in, see Assets Server REST API - introduction.
Parameters
id | Asset id to retrieve the history for. |
start |
First hit to be returned. Starting at 0 for the first hit. Used to skip hits to return 'paged' results. Optional. Default is 0. |
num | Number of hits to return. |
detailLevel |
Level of detail to return. See table below for more information. Optional. Default is 0. Can be customized with actions parameter. |
actions |
Only applies when detailLevel is set to 0. Can be used to return a customized set of actions. See available actions section below. Optional. Default is empty. Returns all actions. |
Available actions
Common actions in Assets Server:
Asset file actions:
- CREATE
- COPY
- MOVE
- RENAME
- REMOVE
Metadata actions:
- METADATA_UPDATE
Checkout actions:
- CHECKIN
- CHECKOUT
- UNDO_CHECKOUT
Version actions:
- CREATE_VARIATION
- COPY_VERSION
- REMOVE_VERSION
Download actions:
- DOWNLOAD
- PREVIEW
- RENDITION
Detail levels
Level | Actions |
---|---|
0 | Customized in 'actions' parameter |
1 | CREATE, CREATE_VARIATION, COPY, COPY_VERSION, CHECKIN |
2 | CREATE, CREATE_VARIATION, COPY, COPY_VERSION, CHECKIN, MOVE, RENAME |
3 | All actions, excluding: CHECKOUT, UNDO_CHECKOUT, METADATA_UPDATE, PREVIEW, AUTHKEY_UPDATE |
4 | All actions, excluding: PREVIEW |
5 | All actions |
Limiting the maximum number of returned records
Info: This feature requires Assets Server 6.112 or higher.
Over time, the number of stored history records for a file can potentially increase to thousands. It may not always make sense to return all these records when performing this API call.
To limit the maximum number of records returned by the Versioning and history API, set the following option in the cluster-config.properties.txt file:
- assetHistoryMaxRecordsAPI (default value is unlimited)
See also Improving Assets Server performance by limiting the assets history output.
Hiding the internal IP address in the History panel of Assets
Info: This feature requires Assets Server 6.113 or higher.
When returning the history data using the API, the internal IP address of the user is also included. This address can be viewed in the History panel of Assets using the developer tools of the web browser and can potentially be used in a malicious attack.
Starting from Assets Server 6.113, this IP address is replaced by the text [hidden]
.
In case the IP address should not be hidden, the following setting in the cluster-config.properties.txt file can be set to false:
- hideInternalNetworkInfo
Examples
Asset history
http://localhost:8080/services/asset/history
?id=9wmc_7LYq2NAmsYU6Lch_t
&detailLevel=0
&actions=CHECKIN
{
"totalHits": 1,
"hits": [
{
"usageStatsRecord": {
"id": null,
"logDate": 1476111682169,
"userName": "admin",
"userGroups": [],
"clientType": "air",
"remoteAddr": "0:0:0:0:0:0:0:1",
"remoteHost": "0:0:0:0:0:0:0:1",
"action": "CHECKIN",
"assetId": "9wmc_7LYq2NAmsYU6Lch_t",
"assetPath": "/Demo Zone/Images/Nature/Wildlife/Parrots.jpg",
"assetType": "jpg",
"assetDomain": "image",
"sourceAssetPath": null,
"sourceAssetId": null,
"changedMetadata": {
"checkedOut": {
"oldValue": 1476111651000,
"newValue": null
},
"software": {
"oldValue": "Adobe Photoshop CS2 Windows",
"newValue": "Adobe Photoshop CS5.1 Macintosh"
},
"artist": {
"oldValue": null,
"newValue": "Fernando Weberich"
},
"description": {
"oldValue": "Two curious parrots (or arara ararauna) overlooking a human crowd in Brazil",
"newValue": null
},
"assetModified": {
"oldValue": 1476111666427,
"newValue": 1476111682098
},
"xmpCreated": {
"oldValue": 1161408099000,
"newValue": 1161400899000
},
"xmpModifyDate": {
"oldValue": 1332506480000,
"newValue": 1476111678000
},
"modified": {
"oldValue": 1332510080000,
"newValue": 1476118878000
},
"assetFileModifier": {
"oldValue": null,
"newValue": "admin"
},
"fileModified": {
"oldValue": 1476111631000,
"newValue": 1476111681000
},
"sourceVersion": {
"oldValue": null,
"newValue": 1
},
"checkedOutBy": {
"oldValue": "admin",
"newValue": null
},
"xmpMetadataDate": {
"oldValue": 1332506480000,
"newValue": 1476111678000
},
"versionNumber": {
"oldValue": 1,
"newValue": 2
},
"assetFileModified": {
"oldValue": null,
"newValue": 1476111682098
},
"checkedOutOnClient": {
"oldValue": "2c3f624f-caba-3f7c-8315-571043e6544c",
"newValue": null
},
"fileSize": {
"oldValue": 750534,
"newValue": 733088
},
"fileCreated": {
"oldValue": 1476111630000,
"newValue": 1476111681000
}
},
"details": null
},
"hit": {
"permissionMask": 1919,
"metadata": {
"extension": "jpg",
"thumbnailState": "yes",
"contentETag": 3,
"versionNumber": 2,
"assetFileModified": 1476111682098,
"assetType": "jpg",
"folderPath": "/Demo Zone/Images/Nature/Wildlife",
"assetDomain": "image",
"filename": "Parrots.jpg",
"assetPath": "/Demo Zone/Images/Nature/Wildlife/Parrots.jpg",
"fileCreated": 1476111681000,
"previewState": "yes",
"name": "Parrots.jpg",
"width": 1600,
"assetFileModifier": "admin",
"id": "9wmc_7LYq2NAmsYU6Lch_t",
"fileModified": 1476111681000,
"previewETag": 2,
"height": 1067
},
"relation": null
},
"versionCreatingAction": true
}
]
}
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.