Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.
I launch external trigger workflow and get error at HTTP Request step,the whole error message is “task failed: activity error (type: sp:external:http:v2, scheduledEventID: 29, startedEventID: 30, identity: 1@sp-workflow-worker-stg-ap-southeast-2-6fc959f99b-slb7q@sp-workflow-engine): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {“error”:“invalid_client”,“error_description”:“Bad client credentials”}“.At Http Request step,I call Account List API,filter is IdenitityId and the results sort by source.displayableName.
I think the problem is not user right because I use the same client_Id and client_sceret to call Account List API by powershell and status code is 200.what reason cause this problem?
Hello @TOPTYU, I suspect the issue with the request URL Can you try updating the values in the URL directly and check if that’s working?
something like this
https://-sb.api.identitynow.com/v2025/accounts?sorters=source.displayableName&filters=identityId eq cf076f5582254ee8a43bf70dcf9eeeba
Why are you building the URL using defineVariable operators? If you type the values directly in the httpRequest action, do you still see the same error?
You don’t need to include %20eq%20%22 in the request URL. Just write the full URL — the workflow engine will handle encoding automatically.
Is there any reason you’re passing the secret as a Request Header? If you remove that and put the secret in the Client Secret field instead, does the error persist?
Your credentials are probably correct, but the way the URLs and the credentials are being passed seems off. Please review all the HttpRequest steps carefully.
First,I use the same client_id and client_secret to call API by powershell and I can get the data successfully.Second,the client_id and client_secret I use is created yesterday.
Instead of defining filters and sorters directly in the URL, could you try adding them separately using the ‘Request URL Parameters’ option provided in the HTTP request action and then test it again?
Given that you mentioned the same API executes successfully with the same credentials via PowerShell.
I call the same api successfully in my partner environment.So,I confuse that if the problem is right of PAT,why I call accountList API successfully by powershell.
1.I reference the doc you provide and change my user level to Admin, Source Admin, HelpDesk.I found ORG_ADMIN not exist in ISC and the user cann’t have source admin and source sub admin the same time
2.I use Request URL Parameter in Http Request Action
Unfortunately,I launch the workflow again the same error still occurred.
start with basic and build each step as you need to make sure you are not lost in the shuffle. the attached is very very basic stuff which is working for me and see if this works else its easy to troubleshoot if its your creds or something else.
As you mentioned that the identity you’re using has been granted admin privileges, could you try generating new PAT credentials and then call the API using those new credentials?
Also, could you try using the v3 version of the APIs once and check if that works?