Not able to get Campaign Filter over API

The API in question:
get-campaign-filter-by-id | SailPoint Developer Community

Gave it the campaign filter ID, but it came back with the following:

{
  "detailCode": "404 Not found",
  "trackingId": "<REDACTED>",
  "messages": [
    {
      "locale": "en-US",
      "localeOrigin": "DEFAULT",
      "text": "The server did not find a current representation for the target resource."
    },
    {
      "locale": "en-US",
      "localeOrigin": "REQUEST",
      "text": "The server did not find a current representation for the target resource."
    }
  ],
  "causes": []
}

Is anyone else able to get a fitler via this API? Tried the v3 API as well, no luck.

Hi @RandomUser4096,

I tried using my postman, it’s working for me.
Could you please verify your api-url and also make sure you are using ‘GET’ and not ‘POST’.

Also, I tried using the get-campaign-filter-by-id | SailPoint Developer Community to send the api request. It actually didn’t work for me there.

Thanks!

Hi Terry,

Try without the ID first to get all campaign filters:
https://sailpoint.api.identitynow.com/v2024/campaign-filters

Then find the ID in the response and then append to the GET above, and it should be all good

https://sailpoint.api.identitynow.com/v2024/campaign-filters/<id>

Hi @RandomUser4096
Most probably, the id you’re using is incorrect.
Please try to GET all the filters using list-campaign-filters | SailPoint Developer Community and try to pull the id from response to use it on get-campaign-filter-by-id | SailPoint Developer Community.

That’s exactly what I did to get the IDs…and then I tried using one of the returned IDs for the subsequent call…and that did NOT work when you run it against get-campaign-filter-by-id | SailPoint Developer Community on the page.

Also tried with the Powershell SDK cmdlet…which also do not work (v3, v2024).

@RandomUser4096
Try to pull it from UI instead of GET all.
https://tenant.identitynow.com/ui/admin/#admin:cert:filters:cd04e2xxxxxxd293b1c and then use the same id to pull.

Thanks, the intent is not to find an API endpoint through undocumented paths, but instead, the documented API endpoints should work as intended.

SailPoint should address the issue if it is deemed to be a bug.

1 Like

You can use the same get-campaign-filter-by-id | SailPoint Developer Community and add the id you found from SailPoint UI.
If this works, you were probably using wrong id earlier.
I don’t see any bug here.

See the 2nd half of Sachin’s response above.

404 is usually when you enter incorrect id. Did you try the UI way ?

No. That’s not the concern (i.e. Not trying to ‘find some way to get the data’, but rather, what should work, should work).

Another example, the following returns the first filter’s ID without issue (PowerShell SDK):
$($(Get-V2024CampaignFilters).items | select-object -first 1).id

But, if I then do this, it wouldn’t return that particular filter object, even though it’s the exact ID that was retrieved:
Get-V2024CampaignFilterById -FilterID $($(Get-V2024CampaignFilters).items | select-object -first 1).id

Hi

What if you use /v3 endpoint instead of /v2024?

I have a script that does uses /v3, and have no issues

listCampaignsFiltersResponse = <GET /v3/campaign-filters>
campaignItemArray = JSON.parse(listCampaignsFiltersResponse.body)["items"] 
campaignItemArray.each {|k| 
	campaignFilterId = k['id']

Same behaviour / issue. V3 was my first choice…thinking it’s relatively more mature / filed tested by others…but no go.

In your code about, you’re only getting a list of filters. Yes, that works. But now, if you try to get ONLY one filter by supplying the ID, that doesn’t seem to work.

It’s the “get campaign filter by ID” that’s not working (for me).

Hey @RandomUser4096 ,

I have not tried with the v2024 api, but the V3 api returns the result.
Please see the below attached postman call.
Here to get the Filter ID i have used this api call: list-campaign-filters | SailPoint Developer Community

Now, just make sure that in Headers, you have Content-Type: application/json
X-SailPoint-Experimental:true
Also the body should be set as none

Here’s the screenshot of same:

Hope this helps :slight_smile:

I have also tried the V2024 endpoint.

URL: {{baseurl}}/v2024/campaign-filters/:id
Here, the ID you will again get from the list-campaign-filters | SailPoint Developer Community

Type: GET
Body: none
Headers: other than general headers include:
X-SailPoint-Experimental:true

Here’s the response i have received:

Hope this also helps

Thanks…so it would seem that there’s an issue with the API documentation interface and the PS SDK cmdlet.

From the API documentation, I get this set of items as expected (from the list campaign filter call):

But when trying to get that filter back individually, by supplying the ID, I get this:

Hi Terry,

Do the request locally (using Postman for example)

Dont do it through developer.sailpoint.com

Yes, that seems to be an issue with the documentation, but if you try with the headers and call i have provided that should work for you.

@colin_mckibben there seems to be missing headers in the API call, can we please look into this.

Indeed, there is an issue with the API specification that is affecting the API explorer within the API specs and possibly even the powershell sdk. I have a fix that is being pushed now. If you run this API using postman or another tool, it will work.

2 Likes

The API explorer is fixed. You can now query campaign filters directly in our specs.