Request for example code to use API endpoints to upload CSV file for Inventory Preload

hcb
New Contributor

Hi,

I tried to use the API to validate and then upload a CSV file to the Inventory preload:

https://developer.jamf.com/jamf-pro/reference/post_v2-inventory-preload-csv-validate

https://developer.jamf.com/jamf-pro/reference/post_v2-inventory-preload-csv

I am able to use other API calls. Just these with the file upload I can not figure out and always get a 400 error.

Could someone share some example code on how to use those 2 API endpoints?

Thanks,

Christian

1 ACCEPTED SOLUTION

mdp
Contributor

Some of the example code on those CSV reference pages is incorrect/misleading, but I believe I figured it out:
https://github.com/MatthewPrins/Jamf/blob/main/Upload_CSV_to_Preload.sh

---
Matthew Prins -- Jamf Scripts @ Github

View solution in original post

2 REPLIES 2

mdp
Contributor

Some of the example code on those CSV reference pages is incorrect/misleading, but I believe I figured it out:
https://github.com/MatthewPrins/Jamf/blob/main/Upload_CSV_to_Preload.sh

---
Matthew Prins -- Jamf Scripts @ Github

hcb
New Contributor

Awesome! Thank you, Matthew! 

The API user does need CRUD access to "Users" and "Inventory Preload Records"