Making attribute searchable for Manager Correlation for AD Connector

Below is the code I’m using to try to make a mangerId IDN attribute searchable. This is based on the documentation: put-identity-attribute | SailPoint Developer Community Is this the correct API I should be using?

I’m receiving a 400 error. I’m using my dev tenant.

<Response [200]>
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ey...
Request for sources failed with status code: 400
Response content: {"detailCode":"400.1 Bad request content","trackingId":"11501d3ea14846f4bee9a2c8ad2ab5b9","messages":[{"locale":"en-US","localeOrigin":"DEFAULT","text":"The request was syntactically correct but its content is semantically invalid."},{"locale":"und","localeOrigin":"REQUEST","text":"The request was syntactically correct but its content is semantically invalid."}],"causes":[]}
base_url = f"https://devrel-**-****.api.identitynow-demo.com"
url = f"{base_url}/beta/identity-attributes/:name=managerId"

# 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)

# API Call to update search attribute
payload = json.dumps({
    "name": "managerId",
    "displayName": "Manager ID",
    "standard": True,
    "type": "string",
    "multi": False,
    "searchable": True,
    "system": False,
    "sources": [
        {
            "type": "rule",
            "properites": {
                "attribute": None,
                "sourceName": "Fred - AD"
            }
        }
    ]
})

headers = {
   'Authorization': f'Bearer {access_token}',
   'Accept': 'application/json',  
   '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)
    

The API documentation with the /:name syntax as an example was throwing me off.

I fixed this with having my url be:
url = f"{base_url}/beta/identity-attributes/managerId"

Note that this is for a demo tenant. If you were to use this for your sandbox or production your base_url needs to be corrected to be identitynow.com rather than identitynow-demo.com.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.