cancel
Showing results for 
Search instead for 
Did you mean: 

Rest Get Query parameter particular filter criteria not working

deeps
New Contributor II

I am doing an API call by passing dynamic timestamp in Query Parameters section , here is the value I am passing
“INSTALLED_SW_LAST_CHANGE_TIMESTAMP%20ge%20”+Date.now().toLocaleDateString()+“T15:00:00-05:00)”.
I am getting status code error 400
image

But if I am passing same value in edit pipeline section as below pic , pipeline works fine.
image
Can you please help me to resolve this issue. Thank you for your help.

8 REPLIES 8

This is weird indeed, can you try to put everything in the Service URL and try it? Don’t pass them via query parameters[Although it should work].

If TIMESTAMP value is hard coded in service URL it works, but if same value given in query parameter it doesn’t work .

eg - https://test.com/latest/INSTALLED_SOFTWARE?$orderby=DEVICE_NAME&$filter=(INSTALLED_SW_LAST_CHANGE_TI...

Hi @Soni37,

I can see your filter added as a query parameter is missing an opening parenthesis, maybe that’s the problem?

Other thing I would like to add is that passing the same expression as a parameter won’t be evaluated, and it is going to be considered as a string.
Meaning, the part Date.now().toLocaleDateString() will not be evaluated tto the current DateTime.

Hope this helps,
Regards,
Bojan

deeps
New Contributor II

@bojanvelevski
The same parameter when given in edit pipeline works, and also when I try to evaluate in query parameter I get valid format.