Skip to main content
Solved

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

  • October 19, 2022
  • 2 replies
  • 21 views

Forum|alt.badge.img+2
  • New Contributor
  • 1 reply

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

Best answer by mdp

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

2 replies

Forum|alt.badge.img+8
  • Contributor
  • 37 replies
  • Answer
  • October 19, 2022

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


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • 1 reply
  • October 19, 2022

Awesome! Thank you, Matthew! 

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