Server API Connect Query Question


#1

I have successfully created a Server API Connection that returns all data from my endpoint as desired.

However I am trying to work out how I can perform the following where clause in the query header.

        url: "http://my.webservice/test/{123456789}/accountlist",
        type: "GET",
        data: {
            "format": "json",
            "where": "reference eq 'ABC01'",
        },
        headers: {
            "Authorization": "Basic bMFuYWdsdsdfsdRZRVy",
            "Content-Type": "application/json",
        },

Any help would be appreciated

Thanks Mim


#2

I’m still trying to work out how I can query the server api data

Name   |   Value
where  |   reference eq "somevalue"

any ideas would be appreciated. Thanks


#3

Just as it in the Query options:

image


#4

Thanks @George
I just cannot seem to use a where value to limit the data query by reference

Gives the following error:

GET operation failed - Badly formed expression reference+eq+'ABC01' - unexpected token: ["eq",<8>,line=1,col=11]

What I am trying to do is replicate what the http client does below and return a single record


#5

Maybe the format and where values should go in to the Input Data and not in the Query … so the grid above .
If passed as query they will be appended to the url as query params - and escaped as such…


#6

It definitely only returns data when format=json is within the query and not the input
If I set the API url to:

http://http://my.webservice/test/{123456789}/accountlist?format=json&where=reference%20eq%20%27ABC001%27

Bingo. It returns the single desired record.
How do I construct that within Wappler?