401 Unauthorized on API calls

PaulL
New Contributor

Hello,

Our JAMF API integration has been working fine for a few years now, but suddenly its stopped working

I've done two things to try to make it work:

1. Changed passwords to be 15 characters

2. Enabled "Allow Basic authentication in addition to Bearer Token authentication" in settings > system > password policy

But still we are getting 401 unauthorized.

Here's our code

Set creds = "%username%:%password%"

Set base64 = base64 "%creds%"

HTTPHEADER "Authorization", "Basic %base64%", "string"

Set tokenjson = HTTPSEND "https://%domainname%/uapi/auth/tokens",  "application/x-www-form-urlencoded", ""

 

And we also tried to get a bearer token, with the same issues

Set creds = "%username%:%password%"

Set base64 = base64 "%creds%"

HTTPHEADER "Authorization", "Basic %base64%", "string"

Set tokenjson = HTTPSEND "https://%domainname%/api/v1/auth/token", "application/json", ""

 

As I said this was all working, so I don't think there's anything wrong with the code, any ideas ?

0 REPLIES 0