A
A
Artem2017-05-12 18:59:50
Yii
Artem, 2017-05-12 18:59:50

How to pass fetch parameters to REST API?

Hello! I got up, now, in front of a problem that I don’t know how to solve, within the framework of REST.
Here, for example: there is a resource "voyages". Get all items - GET api/voyages/. But how can I get, say, all resources that have status = x, let's say? I'm using Yii2 and would normally do it with ActiveQuery by specifying the parameters. But here, in the REST API, there is no QueryBuilder. And how to be? Relatively speaking, I even need to limit the pool of resource objects available to the API user. Many thanks for any information, I hope I did not set it out too confusingly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-12
@webinar

So there is REST in the documentation:
www.yiiframework.com/doc-2.0/guide-rest-quick-star... Everything
is described there. Yii2 has everything you need for REST in 20 minutes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question