I am looking at designing a Rest search API which can accept multiple parameters as filters.
For example:
https://test/api/GetCustomer?Filter=”FirstName=test||LastName=test||telephone=043232323”
The above example will basically do a Or between the fields provided. It is passing the whole search string as one parameter. I want to be able to handle a more complex query as well as below:
https://test/api/GetCustomer?Filter=”(FirstName=test||LastName=test)&&telephone=043232323”
I am not too sure what is the best way to implement the endpoint, it would be easier from frond-end perspective to pass it as a single parameter and than do the parsing at the API level. But obviously it will require more effort to be able to parse the query specially if it is a bit more complex.
Is there a better way to implement the scenario?