how to get the deviceId id from jamf API

royalhemu6655
New Contributor

how to get the deviceId id from jamf API

 

i want to bring the compliance details 

1 REPLY 1

sk25
Contributor
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}”