Include related resources in Admin JSON-API

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
frame86
Posts: 4
Joined: 23 May 2017, 17:11

Include related resources in Admin JSON-API

Post by frame86 » 23 May 2017, 17:37

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

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Include related resources in Admin JSON-API

Post by aimeos » 23 May 2017, 22:58

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!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

frame86
Posts: 4
Joined: 23 May 2017, 17:11

Re: Include related resources in Admin JSON-API

Post by frame86 » 24 May 2017, 08:06

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.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Include related resources in Admin JSON-API

Post by aimeos » 24 May 2017, 08:50

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

frame86
Posts: 4
Joined: 23 May 2017, 17:11

Re: Include related resources in Admin JSON-API

Post by frame86 » 24 May 2017, 09:22

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.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Include related resources in Admin JSON-API

Post by aimeos » 29 May 2017, 10:05

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

frame86
Posts: 4
Joined: 23 May 2017, 17:11

Re: Include related resources in Admin JSON-API

Post by frame86 » 29 May 2017, 17:30

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?

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Include related resources in Admin JSON-API

Post by aimeos » 29 May 2017, 19:29

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply