I have pasted the python script below, any help on why this wouldn’t be working? I’m using my PAT client id and secret. My Identity is an Org Admin.
Is there a beta api that replaces this functionality?
import requests
import json
# Set the necessary variables
client_id = "<pat client id>"
client_secret = "<pat secret>"
base_url = f"https://example.api.identitynow.com"
url = f"{base_url}/cc/api/system/refreshidentities"
# Get an access token
auth_url = f"{base_url}/oauth/token"
auth_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret,
}
auth_response = requests.post(auth_url, data=auth_data)
print(auth_response)
#Extract the access token from the response
access_token = auth_response.json()["access_token"]
print(access_token)
payload = json.dumps({
"filter": "costCenterId == \"01.74100\"",
"refreshArgs": {
"correlateEntitlements": "true",
"promoteAttributes": "true",
"refreshManagerStatus": "true",
"provision": "true",
"synchronizeAttributes": "true"
}
})
headers = {
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json'
}
response = requests.request("PUT",url, headers=headers, data=payload)
if response.status_code == 200:
data = response.json()
else:
print(f"Request for sources failed with status code: {response.status_code}")
print("Response content:", response.text)