akeneo / api-php-client

PHP client of Akeneo PIM API
https://packagist.org/packages/akeneo/api-php-client
Other
90 stars 57 forks source link

Assets interface on new client not available? #287

Closed nei closed 1 month ago

nei commented 1 month ago

I've just installed the client and trying to use some examples from the docs like $client->getAssetApi()->create( and it says getAssetApi is not available.

Fatal error: Uncaught Error: Call to undefined method Akeneo\Pim\ApiClient\AkeneoPimClient::getAssetApi

this is my version:

import> composer info akeneo/api-php-client
name     : akeneo/api-php-client
descrip. : Akeneo PIM client for the API
keywords : 
versions : * v6.0.1
type     : library
license  : Open Software License 3.0 (OSL-3.0) (OSI approved) https://spdx.org/licenses/OSL-3.0.html#licenseText

I am interested in the asset manager like showed on the docs.

   $cursor = $client->getAssetManagerApi()->all('user_instructions');
StevenVAIDIE commented 1 month ago

Hello Nei,

Yes getAssetApi is not available anymore since PIM 4.0 (The endpoint didn't exist anymore). l didn't remember in which version of api-php-client this method have been removed.

For all thing about asset manager please see the following doc: https://api.akeneo.com/php-client/resources.html#asset-manager

The documentation about PAM is deprecated as explained here: https://api.akeneo.com/php-client/resources.html#pam-em-deprecatedem

nei commented 1 month ago

Thank you @StevenVAIDIE I ended up realising that depending of the php version you use it install a different version of the API. I've upgraded my php and managed to sort it. thank you anyway.