Skip to main content
Question

how to get the deviceId id from jamf API

  • September 5, 2023
  • 1 reply
  • 50 views

Forum|alt.badge.img+1

how to get the deviceId id from jamf API

 

i want to bring the compliance details 

1 reply

Forum|alt.badge.img+5
  • Contributor
  • September 7, 2023
Hope this might help..

#! /bin/sh

 

# server connection information

jamfProURL="https://XX.jamfcloud.com"

username=“<local Jamf username should come here>”

password=“<local Jamf password should come here>“

 

## get computer ID from Jamf server

compId=$( /usr/bin/curl \\

--request GET \\

--url "$jamfProURL/JSSResource/computers/udid/${udid}/subset/general" \\

--header "Authorization: Bearer $token" \\

--header "Accept: application/xml" \\

| /usr/bin/xpath -e '/computer/general/id/text()' 2> /dev/null )

 

echo “${compID}”