Apply $filter to Rest api call
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 12:02 PM
Hello All,
I'm trying to make an API call as below
"http://example.com/api/v1/Items?$filter=criteria/itemID eq 'abc'";
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('get');
request.setEndpoint(endpoint);
request.setQueryParameter('$filter',"criteria/itemID eq 'abc'");
but I'm getting all results without filter applied. Working as expected in Postman though.
Can anyone point what is wrong here please.
Thank you.
Labels:
- Labels:
-
Integrations
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 05:39 PM
Hi, your query string shows an extra single quote, perhaps this is the issue?
'$filter',"criteria/itemID eq 'abc''"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2022 06:16 AM
Thanks Tony, that's mistake on post but I have it correct in my script, that's not the issue.