Query Regarding Rest Api

I am trying to fetch data and filter data from erpnext customized site.
When i fetch the fields of the doctype i use the url:- https://runga.rungamatteegroup.com/api/resource/Tea%20Invoice?fields=["name","grade","status","invpr","invsuf","estatename","dop"]
I get the data absolutely fine.
When i fetch the data with filtration, using the url:- https://runga.rungamatteegroup.com/api/resource/Tea%20Invoice/?filters=[["Tea%20Invoice",%20"status",%20"=",%20"Sold%20&%20Delivered"]]
I get the data absolutely fine.

When i try to merge the fields and filter in the url as querystring , i am not able to get it together. the url is :-
https://runga.rungamatteegroup.com/api/resource/Tea%20Invoice/?fields=["status","name","dop"]?filters=[["Tea%20Invoice",%20"status",%20"=",%20"Sold%20&%20Delivered"]]

I am trying this to get the fields of the filtered data only.

Please suggest @saurabh6790!

Please don’t tag specific users for your answers.

Your query string is not created properly. The parameters have to be joined by & and not ?.

1 Like

Okay Sir! I will keep it in mind. Thank you for correcting me.

Sir should the URL be this : - https://runga.rungamatteegroup.com/api/resource/Tea%20Invoice/&fields=["status","name","dop"]&filters=[["Tea%20Invoice",%20"status",%20"=",%20"Sold%20&%20Delivered"]]

Its not working! Please suggest!

https://runga.rungamatteegroup.com/api/resource/Tea%20Invoice/?fields=[“status”,“name”,“dop”]&filters=[[“Tea%20Invoice”,%20"status",%20"=“,%20"Sold%20&%20Delivered”]]

Try this.

This is not working ! I had tried many combinations of fields and filters together. They work fine separately but together they are giving server error.

try this

https://runga.rungamatteegroup.com/api/resource/Tea%20Invoice&fields=["status","name","dop"]&filters=[["status","=","Sold%20%26%20Delivered"]]

& from Sold & Delivered is %26

Sir! Its not working. :frowning:

what you get in response?

it shows an alert box displaying :-

“The resource you are looking for is not available”.
But in my table has data of the filters and fields given.

better don’t post any of your production or development domains… replace it with example.com

Sorry I didnt get it.
Please elaborate.
Actually I am developing a mobile app where i can view doctypes data on filtration. So i need the help of Rest Apis.

Thank you sir!. I got it right now. I was getting error due to extra spaces.