Powershell API error when search identities in a specific source

Hi Guys,

I’m trying to update our S3 bucket Powershell API. We are using sailpoint identitynow. We used the put request, but i’m getting the following error.

Here is the put request
(https://{tenant}.api.identitynow.com/v3/search/identities?&query=(@accounts(source.name:“', $source, '”))

The Error:
Invoke-WebRequest : {“errorName”:“NotAllowedException”,“errorMessage”:“RESTEASY003650: No resource method found for GET, return 405 with Allow header”,“trackingId”:“afa6a27f4d904235b0b804f544566400”}

My goal is to get the list of identities inside the source

Hope you can help me.

Thank you in advance.

Hi @ABV11 ,

Any specific reason you intend to use PUT method? /v3/search only supports POST and GET.

Thanks,
Shailee

Hi Shailee,

Good day.

Apologies, it should be POST method.

Thanks,
Bryan

Hi @ABV11,

You can get the list of all identities with the particular source account using below API -

API -
https://{tenant}.api.identitynow.com/v3/search/identities

Headers -

'Content-Type: application/json'
'Accept: application/json'
'Authorization: Bearer <token>'

Body -

{
    "query": {
        "query": "@accounts(source.name:\"$source\")"
    }
}
2 Likes

Hi Shailee,

This works.

Thank you so much for the help.

1 Like

Hi Guys,

I am trying the two queries using this options in powershell but having issues. When I am using it in postman I did not had any issues but when I am using the query on powershell it won’t give me results.

Here is the issue that I am getting
Invoke-WebRequest : Forwarding error


$accountUrl = -join(‘https://Sailpoint.api.identitynow.com/v3/search/identities?{“query”: {“query”: “(@accounts(source.name:"Sample") AND created:[now-20000h TO now])”}, “includeNested”:false, “sort”:[“displayName”]}’)


$body = @"

{“query”: {“query”: “@accounts(source.name:"Sample")”}}

"@

Hope you can help

Thank you.