-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Describe the bug A clear and concise description of what the bug is.
When using the Python SDK, I am able to successfully authenticate against the tenant using the PAT with "all" permissions. I'm creating a search to pull identities in my script, and then I iterate through that identities list to initiate a workflow for each of them. When I do that, I see permissions issues which I believed were resolved.
To Reproduce Steps to reproduce the behavior:
- Reproduce my code:
import sailpoint
import sailpoint.v3
from sailpoint.configuration import Configuration
from sailpoint.paginator import Paginator
from sailpoint.v3.api.workflows_api import WorkflowsApi
from sailpoint.v3.api_client import ApiClient
from sailpoint.v3.models.create_external_execute_workflow200_response import CreateExternalExecuteWorkflow200Response
from sailpoint.v3.models.create_external_execute_workflow_request import CreateExternalExecuteWorkflowRequest
import sailpoint.beta
import json
configuration = Configuration()
api_client = sailpoint.v3.ApiClient(configuration)
search = sailpoint.v3.Search(
indices=['identities'],
query=sailpoint.v3.Query(query='attributes.workerType:consultant AND _exists_:manager'),
sort=['-name'])
identities = Paginator.paginate_search(sailpoint.v3.SearchApi(api_client), search, increment=5, limit=5)
id = '66c9d544-5b7e-4074-a517-c06e8100b035' # str | Id of the workflow
for identity in identities:
try:
# Access identity attributes according to SailPoint's documented structure
payload = {
'id': identity['id']
#'firstName': identity['firstName'], # Direct attribute access
#'displayName': identity['displayName'],
#'startDate': identity['startDate'],
#'uid': identity['uid'],
# Access manager details through info map
#'managerId': identity['info']['manager']['id'],
#'managerName': identity['info']['manager']['name']
}
create_external_execute_workflow_request = CreateExternalExecuteWorkflowRequest(input=payload)
results = WorkflowsApi(api_client).create_external_execute_workflow(id, create_external_execute_workflow_request)
print("Workflow execution response:")
print(results.model_dump_json(by_alias=True, indent=4))
except Exception as e:
print(f"Error: {e}\n")- Run the code in Python version 3.9 (I learned that the SDK doesn't work with 3.13)
Expected behavior A clear and concise description of what you expected to
happen.
The script should iterate through the list of identities and initiate a workflow for each one.
Actual behavior A clear and concise description of what actually happens.
I get permissions issues, despite my config file being set up correctly (and confirmed that it was set up correctly by Tyler Mairose, Briane Bullock, and others). Here is the error I'm receiving (note: this repeats for each identity in the list):
Error: (401)
Reason: {"detailCode":"Unauthorized","trackingId":"b7d47a6a92c243f0b87040e5bfdbb67d","messages":[{"locale":"en-US","localeOrigin":"DEFAULT","text":"Unauthorized"}]}
HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 25 Mar 2025 20:01:11 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '156', 'Connection': 'keep-alive', 'Server': 'nginx', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'SLPT-Request-ID': 'b7d47a6a92c243f0b87040e5bfdbb67d', 'Access-Control-Expose-Headers': 'SLPT-Request-ID, Content-Type', 'X-Robots-Tag': 'noindex'})
HTTP response body: error=None
Screenshots If applicable, add screenshots to help explain your problem.
NA
Operating System (please complete the following information):
- OS: Mac OS Sequoia 15.3.2 (24D81)]
- CLI Environment: Terminal
- Version: Apple_Terminal 455
Browser (please complete the following information):
- Browser: Chrome
- Version: 134.0.6998.166 (Official Build) (arm64)
Additional context Add any other context about the problem here.