cancel
Showing results for 
Search instead for 
Did you mean: 

API query invalid in SnapLogic, but valid in Postman

Garrett
New Contributor II

Split out from: 401 Error using Https in API REST GET call

Did you ever solve your issue?

I am experiencing something similar. To answer the question the User-Agent can be anything. Something like SnapLogic/version# replacing the number.

My issue is that when I run it in Postman I get results.
When I run it in SnapLogic the Server is saying that the query is invalid.

17 REPLIES 17

Do you have the “=“ sign enabled to make it evaluate as an expression and not just plain text?

Garrett
New Contributor II

I get this error:

Could not compile expression: https://serviceurl … (Reason: Encountered extraneous input ‘:’ at line 1:5; expecting={, ‘||’, ‘&&’, ‘^’, ‘==’, ‘!=’, ‘>’, ‘<’, ‘>=’, ‘<=’, ‘+’, ‘-’, ‘*’, ‘/’, ‘%’, ‘?’, ‘instanceof’, ‘in’, ‘matches’, ‘[’, ‘(’, ‘.’, PropertyRef}; Resolution: Please check expression syntax)

Query parameter looks like this:
image

incase the image doesn’t work:

Query parameter | Query parameter value
query | encodeURIComponent(‘select * from mytable where id < 1000’)

using your expression I am seeing this result:
Screen Shot 2021-01-29 at 9.16.58 AM

It is not necessary to use encodeURIComponent. The REST Get snap will properly encode the query parameter values. Can you please show the full configuration of your REST Get snap?

I also have to say that providing a REST service which accepts a SQL command to execute against your database seems like a rather significant security vulnerability.