Hi all,
It's been some time since I've developed an API in Yii2 but I'm now trying to remember how to query or implement what I think is builtin options in an API but I can't seem to find them now so I'm unsure.
Is there an option to query multiple records with the standard detail request like `GET /users/1,2,3` to list these three users.
Also I kind of remember you could add related models in the URL that you want to include in the response. For example, if by default user.posts is not included in the user response, you could optionally include in the request like `GET /users/1?with=posts`.
Is this right? I'm trying it and searching Google but not finding them.
Page 1 of 1
RESTful API forgotten URI options
#2
Posted 01 August 2017 - 03:14 PM
There is no option to get multiple records via IDs yet. https://github.com/y...ii2/issues/4478
Related models are included via "expand", not via "with".
Related models are included via "expand", not via "with".
Yii 2.0 Development Cookbook
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
Share this topic:
Page 1 of 1