Home > Software design >  Using query as a query parameter
Using query as a query parameter

Time:04-08

I am using poorly documented API, so I suppose that there is a common practice since they didn't explained the way it should be used. API endpoint supports following query parameters: query (string) and pageNumber (integer) - the part that confuses me is query inside of query.

For example, I want to check all orders with property that has some value: https://api.logsta.com/orders?query=orderIdentifier=106300 but it doesn't work. For me, the natural behaviour would be https://api.logsta.com/orders?orderIdentifier=106300 but this is impossible since they require this query query parameter.

Based on your experience, what should I pass into this query to make it work? Is it a SQL expression or there is a standardized approach?

CodePudding user response:

you can use url encode

?query=orderIdentifier=106300

CodePudding user response:

I found the solution, and it works, so I hope that this scenario could be useful to someone.

https://api.logsta.com/orders?query=orderIdentifier:300000169928409

instead of using = again or URL encoding, they are accepting :

  • Related