Python SDK disable account comes back as successful but account does not disable

When I try to disable an Identities account using the python SDK, the http response comes back as ‘202’ suggesting that it executed successfully and it also gives the task id of the task created to perform the disable. However, when going into IDN, the account is not disabled.
I have checked the identities events, aggregated the account I am trying to disable, processed the identity, done this using postman which works - but still no success
This is the python code I am using to do the disable:

import sailpoint

import sailpoint.v3

from sailpoint.configuration import Configuration

configuration = Configuration()

api_client = sailpoint.v3.ApiClient(configuration)

accounts_api_instance = sailpoint.v3.AccountsApi(api_client)

response = accounts_api_instance.disable_account_with_http_info(account_toggle_request=sailpoint.v3.AccountToggleRequest(externalVerificationId="", forceProvisioning=False),id="2c91808383ea51eb0183eb7dc79027da")

print(response)

And this is the output I get:

status_code=202 headers={'Date': 'Thu, 29 Aug 2024 19:29:25 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'nginx', 'Vary': 'Access-Control-Request-Headers', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'SLPT-Request-ID': '55e58e1463544bd7a64d82424b69267e', 'Access-Control-Expose-Headers': 'Retry-After,Connection,SLPT-Request-ID,Content-Length,Date,X-Zuul-ServiceId,Content-Type', 'X-Robots-Tag': 'noindex'} data=AccountsAsyncResult(id='9cca7e87f6d040ad83625a1462955d1c') raw_data=b'{"id":"9cca7e87f6d040ad83625a1462955d1c"}'
PS C:\Users\Chris.Lamprecht\Specsavers\python-template> python .\disableAccount.py
status_code=202 headers={'Date': 'Thu, 29 Aug 2024 19:33:43 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'nginx', 'Vary': 'Access-Control-Request-Headers', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'SLPT-Request-ID': '7af8956b5d714500a0625a0284dd8160', 'Access-Control-Expose-Headers': 'Retry-After,Connection,SLPT-Request-ID,Content-Length,Date,X-Zuul-ServiceId,Content-Type', 'X-Robots-Tag': 'noindex'} data=AccountsAsyncResult(id='7997733c0e4a4f0489372f51f273b81a') raw_data=b'{"id":"7997733c0e4a4f0489372f51f273b81a"}'

The code above is for testing, the reason why I want to use the SDK is I have another script that disables multiple accounts for many identities. But I need to get the disabling of the account to work before I continue.

Hi @Chrisiam ,

Welcome to the SailPoint Developer Community!

If you search the same user in the Search UI, you should be able to see his Events and Account Activities. Can you check if any disable is happening from Account Activities.

Thanks,
Shailee

Hi Shailee,

Thank you and thank you for the response. I have searched the user and checked their events and account activity and no disable account shows up. I have been checking this for a few days to be positive it doesn’t show.

Hi @Chrisiam ,

I am sure you have checked this, but to reconfirm if the accountID value is correct?

Also, when you get the response, can check the eventID, e.g. 9cca7e87f6d040ad83625a1462955d1c in the above, which is returned in the 202 response body via search UI.

Thanks,
Shailee

Hi @shaileeM,

Thanks again for the response.

I have made sure the accountID value is correct. When putting the eventID in the search it states the events name as “Change Identity Lifecycle State Success” and interface as “Cloud Lifecycle Change”. I am not sure why it returns this for the event.

Hi @Chrisiam ,

This seems strange. Are you able to hit the same api using postman?

Yeah it works fine when using postman

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