{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
Attachments
The Attachments handler returns information about attachments added to a specific asset.
GET /api/inventory/<asset-id>/attachments
Fetch a list of attachments for the asset given by the asset-id
.
RESPONSE Fields | Value Type | Description |
---|---|---|
name | String | The name of the attachment file |
lastModified | Number | The timestamp of the last modification date of the attachment |
fileLength | Number | The size of the attachment in bytes |
url | String | The URL to this attachment. It can be used together with the server's base URL to load the attachment. |
Example Request
# Request GET /api/inventory/0000000014dda45eb9fe2ecb0/attachments HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Response HTTP/1.1 200 OK Content-Type: application/json [ { "name": "DreamShaper_v7_a_set_of_air_pods_and_beats_pro_on_a_table_of_a_2.jpg", "lastModified": 1695729773509, "fileLength": 525018, "url": "Attachments/device/155/DreamShaper_v7_a_set_of_air_pods_and_beats_pro_on_a_table_of_a_2.jpg" } ]
# Request DELETE /api/inventory/0000000014dda45eb9fe2ecb0/attachments/DreamShaper_v7_a_set_of_air_pods_and_beats_pro_on_a_table_of_a_2.jpg HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Response HTTP/1.1 200 OK Content-Type: application/json
Application Example
# Browser access http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/attachments # Shell access using curl curl -LsH "Authorization: Bearer <access_token>" "http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/attachments" # Shell access using curl using username and password curl -Lsu username:password "http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/attachments"
# Shell access using curl curl -X DELETE -LsH "Authorization: Bearer <access_token>" "http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/attachments/DreamShaper_v7_a_set_of_air_pods_and_beats_pro_on_a_table_of_a_2.jpg" # Shell access using curl using username and password curl -X DELETE -Lsu username:password "http://127.0.0.1:9000/api/inventory/0000000014dda45eb9fe2ecb0/attachments/DreamShaper_v7_a_set_of_air_pods_and_beats_pro_on_a_table_of_a_2.jpg"
DELETE /api/inventory/<asset-id>/attachments/<attachment-name>
This handler can also be used to remove an attachment from the given inventory asset. You simply send a DELETE
command to the specific asset attachments handler.