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 certificateIf you're using a self-signed SSL certificate, you may need to pass the
--insecureflag 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]" --verboseList Files
curl --request GET --url http://your-snipe-it/api/v1/hardware/1/files --header "Authorization: Bearer xxxxxxxxxx" --header 'accept: application/json' --verboseRetrieve a File
curl --request GET --url http://your-snipe-it/api/v1/hardware/1/file/1 --header "Authorization: Bearer xxxxxxxxxx" --output downloadedfile --verboseDelete 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