ZF-5434: Zend_Service_Amazon uses api version 2005-10-05


I think it would be a good idea to be able to specify the version you'd like to use. An example would be:

$amazon = new Zend_Service_Amazon('****','CA'); $amazon->setVersion('2008-08-19'); $results = $amazon->itemSearch(array( 'SearchIndex' => 'Jewelry', 'Keywords' => 'gold necklace', 'ResponseGroup' => 'Small,ItemAttributes,Images,SalesRank,Reviews,EditorialReview,Similarities,ListmaniaLists' ));

From taking a quick look through the only update I can see to the class would be the following:

adding the public function setVersion which would set $this->version in _prepareOptions check to see if this->version is set and if so update the query to include the Version parameter in _checkErrors update the namespace to '…->version

quoted from the amazon best practises:

"Amazon Associates Web Service makes frequent releases. Each release either adds functionality or increases the accuracy, speed, and stability of Amazon Associates Web Service. Most releases do both. Check frequently for documentation about the latest release.

To use the latest version of the API, you must include the version parameter in your requests. Otherwise, Amazon Associates Web Service uses the default API version, which is from 2005-10-05"…


The question is, does the result-sets change between the different versions?

The problem I'm facing with this is that some ResponseGroups did not exist back in 2005. So using the version "2005-10-05" doesn't work with the newer responsegroups. The responsegroup "RelatedItems" for instance doesn't work right now. Even if the results sets do not differ, In my opinion it's not a good practice to have variables hard-coded anyways and this could easily be fixed.

Reassigned to component maintainer

I have also run into the same issue. I modified my code to use version 2007-10-29 and everything seems to be fine with the drop in replacement. As clintonne says, some ResponseGroups did not exist in 2005 which limits the amount of information we can retrieve from the service. Having the ability to control which version of the API we would like to use would be very helpful.

This has become an issue with the latest API update. More details about the update can be found here…

Besides that amazon already removed various information from the current api version, it will become invalid in a few months. So having control over the api version would allow us to use new features without the need of a zend update.

Assigning to Enrico

Any movement on this? Here is an example why we should push this forward - In this case, users can just set the version in the code instead of messing around the framework.

ZF-12046 will be resolved in ZF 1.12.0

As for changing Zend_Service_Amazon to allow selecting the API version, that will not be added to ZFv1 at this late stage in it's lifecycle. I will clone this ticket into the Zend Framework 2 JIRA project so that it remains on the radar for ZFv2.

See ZF2-293