Asset files may be managed via API using the following example calls. Note that you will have to replace http://your-snipe-it
with your Snipe-IT url, and the xxxxxxxxxxxx
with your actual bearer token.
Using a self-signed certificate
If you're using a self-signed SSL certificate, you may need to pass the
--insecure
flag on these calls.
Upload a file
curl --request POST --url http://your-snipe-it/api/v1/hardware/1/files --header "Authorization: Bearer xxxxxxxxxx" -F "file[][email protected]" --verbose
List Files
curl --request GET --url http://your-snipe-it/api/v1/hardware/1/files --header "Authorization: Bearer xxxxxxxxxx" --header 'accept: application/json' --verbose
Retrieve a File
curl --request GET --url http://your-snipe-it/api/v1/hardware/1/file/1 --header "Authorization: Bearer xxxxxxxxxx" --output downloadedfile --verbose
Delete a File
curl --request DELETE --url http://your-snipe-it/api/v1/hardware/1/file/1 --header "Authorization: Bearer xxxxxxxxxx" --header 'accept: application/json' --verbose