Jamf API/Posting info to another service


I'm going to try to explain this the best I can because I don't have a lot of experience with API so sorry in advance.

When a Mac gets enrolled in Jamf, I would like the Jamf API to post to our Inventory system (we are mostly a Windows shop so we don't use Jamf for Inventory) via its API. Does anyone have a script or know of a link posted here that would be a good starting point?

Would the script essentially need to be ran at enrollment complete trigger on the Mac?

How would I do this with iPads since I cannot run scripts on iPads?

Do I even make sense? I guess I just need a good starting point.


New Contributor III

@dmitchell Webhooks will probably get you what you need (https://developer.jamf.com/webhooks). The ComputerAdded webhook is the one to take a look at for computers and MobileDeviceEnrolled for mobile devices.


@beckerbm That's a good starting point, thank you.

Contributor II

So, here's what I have setup for macOS: techs set all new machines up. Provisioning script collects a lot of information and populates into extension attributes, and saves them into a csv that is dumped in a shared location for a script to capture and create a record in our inventory system.

I also have several scheduled tasks (powershell scripts) that run daily/weekly/etc on some of our Windows servers to then query API and write to our inventory system or vice-versa. I also get notifications in Teams if a user enrolls their own machine so we need to follow up, have a regular clean-up task that will let us know if a mac hasn't checked in in 6 months, and will mark a device as unmanaged/delete depending on inventory system record.

I would recommend that you first figure out what you need to be able to ingest into your inventory system and then how you want everything structured. - Is it all information that can be grabbed without touching the machine? If so, maybe you can just run daily queries/syncs. - Will you have multiple tasks? If so, what kind of timing should you run? - Do users have the ability to self-enroll? Maybe you need to distinguish somehow and know if it was set up properly or if a user enrolled themselves.

iPads would not be able to run scripts, so might need a separate query for that.

You can also view a lot of info on https://your-jps.com/api or https://developer.jamf.com/documentation. the macadmins slack #jss-api channel is also very active with people willing to help.