eZ Community » Forums » Developer » REST API : filter on a field
expandshrink

REST API : filter on a field

REST API : filter on a field

Thursday 08 March 2012 11:48:43 am - 5 replies

Hello

I would like to use another filter than limit, offset or sort when I ask my webservice, and add another parameter, like :

 http://www.mysite.com/ezp/v1/content/node/16076/list/myattribute/1234

myattribute represent an object relation datatype (I can put the ID objetc or the ID node).

I would like to use ezpContentCriteria::field but the functions are not implemented in the file /kernel/private/api/content/criteria/field.php.

Is someone know how can I have to do to define this functions ?

Or perhaps there is another way to do that ?

It seems very complicated to me...

Thank you for help

Modified on Friday 09 March 2012 9:46:16 am by Solène Guillot

Monday 12 March 2012 5:27:21 pm

I think I went in the wrong direction.

Firstly Is it possible to pass parameters in the HTTP header (and not in the url) ?

Then How to handle properly the parameters in the code?

For example, I would like to see a list of restaurant objects with a particular city (parameter passed by GET). Can I use ezcontentobjecttreenode :: subTreeByNodeID ?

I'm lost thank for help

Monday 12 March 2012 7:09:46 pm

Q1: do you want to implement new rest api services, or are you trying to use the existing ones?

Monday 12 March 2012 7:51:44 pm

For the moment I try to use the ezprestapiprovider, and the route /api/ezp/v1/content/node/xxx/list I don't know if it's the right way...

Tuesday 13 March 2012 3:40:46 pm

I don't know, either. But it it turns out not to work, you can create your own rest api service provider...

Tuesday 13 March 2012 3:47:49 pm

You're right. Finally I did my own provider, with my own routes and my own functions which do what I want.

Thank you anyway

Modified on Tuesday 13 March 2012 3:48:06 pm by Solène Guillot

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from