Apply $filter to Rest api call

Bharath38
Tera Guru

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.

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, your query string shows an extra single quote, perhaps this is the issue?

'$filter',"criteria/itemID eq 'abc''"

Thanks Tony, that's  mistake on post but I have it correct in my script, that's not the issue.