Page 1 of 1

Include related resources in Admin JSON-API

Posted: 23 May 2017, 17:37
by frame86
Hi, I have tried to work with the Admin JSON-API via TYPO3 as described in https://aimeos.org/docs/Developers/Admi ... arch_items.

The query options page and sort are working well, but nothing happens if I set a value for include or using the fields filter.
I want to get the prices with the product-query, so I set include to "price".

Maybe I'm using it wrong? How can I get
- Products with prices
- All products within a category?

To bad the API just ignores my supplied data instead of returning some error.

Aimeos 17.4.0 - PHP7.1/Linux

Re: Include related resources in Admin JSON-API

Posted: 23 May 2017, 22:58
by aimeos
frame86 wrote:The query options page and sort are working well, but nothing happens if I set a value for include or using the fields filter. I want to get the prices with the product-query, so I set include to "price".
You are right, we've remove something by accident that is necessary to create the right objects to retrieve the associated data. This is fixed in dev-master now.
frame86 wrote:How can I get
- All products within a category?
Be careful about that, it may be an extremely large amount of data!

Re: Include related resources in Admin JSON-API

Posted: 24 May 2017, 08:06
by frame86
Thank you, but could you tell me which repository/commit I have to looking for?
If I clone the aimeos/aimeos-typo3/master repository from github, I getting an older version than my installed one? (17.3.1-pre1 vs 17.4.0)
I also tried the core only, but it seems also not compatible with the TYPO3-Wrapper-extension.

Re: Include related resources in Admin JSON-API

Posted: 24 May 2017, 08:50
by aimeos
The shown version in the extension manager isn't update regularly in the dev-master branch. We've set it to 17.7.0-dev now so it's more clear where this branch is heading to.

Please also not that we've corrected the documentation for the "fields" parameter.

Re: Include related resources in Admin JSON-API

Posted: 24 May 2017, 09:22
by frame86
Have tried it but cannot get it running:

The direct clone of https://github.com/aimeos/aimeos-typo3.git throws the exception:
Class 'Aimeos\Bootstrap' not found

If I do a composer update (clearing cache first):
Class "\Aimeos\MShop\Common\Manager\Decorator\Sitecheck" not available

As I said. Something between this wrapper and the core is not compatible.

Re: Include related resources in Admin JSON-API

Posted: 29 May 2017, 10:05
by aimeos
Did you set up TYPO3 in composer mode? This is necessary to get an environment where you can update the Aimeos packages using "composer update". Then the versions of all packages will fit together.

Alternatively, we can offer a new Aimeos TYPO3 extension zip file.

Re: Include related resources in Admin JSON-API

Posted: 29 May 2017, 17:30
by frame86
Ah thank you! I wasn't aware that TYPO3 was that dumb to need to go into a composer mode.

As you mentioned about large amount of data:
Wouldn't it be better if the relationship-field only contains the ids instead of the complete data?

Re: Include related resources in Admin JSON-API

Posted: 29 May 2017, 19:29
by aimeos
This would violate the jsonapi.org standard.
If you need to get the products of a category, you should use the product endpoint passing the category ID as "f_catid" parameter.