Not sure if anybody have seen, but with the 10.35.0 Jamf Pro version, it seems like classic API can be used with the bearer token authentication: https://developer.jamf.com/jamf-pro/docs/classic-api-authentication-changes
When I am trying to use the code samples to simply get all sites from JSS with a simple curl command:
apiURL="JSSURL"
username="USERNAME"
password="PASSWORD"
# created base64-encoded credentials
encodedCredentials=$( printf "$username:$password" | iconv -t ISO-8859-1 | base64 -i - )
allSiteData=`curl -X GET \\
$apiURL/JSSResource/sites/ \\
--header 'authorization: Basic $encodedCredentials'`
echo "AllsiteData is: $allSiteData"
I get:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 422 100 422 0 0 2562 0 --:--:-- --:--:-- --:--:-- 2740
AllsiteData is: <html>
<head>
<title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Unauthorized</p>
<p>The request requires user authentication</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>
Anybody tried this out yet / any suggestions?