New here? Read Greetings Earthling!

Amazon Operations / Response Groups / Parameters For PHP

I scraped the latest Amazon API Help Operation and got a decent list of Operations, Response Groups and Response Groups / Parameters for each Operation. These are all defines as they work best with my PHP Editor. Create a new amazon_defines.php and paste all these in and require_once() when needed.

The Light Section

The defines in the light section alone can get you through the day but the heavy section has the association which you could also use.

The Amazon Operations

Follows this naming convention: AMA_OP_{OPERATION_NAME} e.g.: AMA_OP_BROWSENODELOOKUP

Zone unavailable to unregistered users.
Registration is quick, painless and worth its weight in gold.

The Amazon Response Groups

Follows this naming convention: AMA_RG_{RESPONSE_GROUP} e.g.: AMA_RG_BROWSENODEINFO

Zone unavailable to unregistered users.
Registration is quick, painless and worth its weight in gold.

The Amazon Parameters

Follows this naming convention: AMA_PARAM_{PARAMETER_NAME} e.g.: AMA_PARAM_BROWSENODEID

Zone unavailable to unregistered users.
Registration is quick, painless and worth its weight in gold.

... And The Heavy Section

This contains the missing links between Operations and Response Groups / Parameters. To undertand this we need understand the naming structure. The defines are named in such way that you can easily remeber and use them.

Each Operation can accept a certain list of Reponse Groups and a certain list of Parameters. As I mentioned above, operations are named AMA_OP_{OPERATION_NAME}.

  • Each Operation Response Group is named: AMA_{OPERATION_NAME}_RG_{RESPONSE_GROUP} e.g.: AMA_BROWSENODELOOKUP_RG_BROWSENODEINFO
  • Each Operation Parameter is named: AMA_{OPERATION_NAME}_PARAM_{PARAMETER_NAME} e.g.: AMA_BROWSENODELOOKUP_PARAM_BROWSENODEID

Get the defines here.

    Zone unavailable to unregistered users.
    Registration is quick, painless and worth its weight in gold.

    And For The Puzzled

    Some may wonder why all the insane defines here. Because it's how I roll. If I need to do an ItemSearch I do this:

    1. Operation name is AMA_OP_ITEMSEARCH
    2. I need ResponseGroups so I type [ctrl+space] AMA_ITEMSEARCH_RG_ and the editor presents all ResponseGroups for ItemSearch
    3. And I need Parameters so I type [ctrl+space] AMA_ITEMSEARCH_PARAM_ and the editor presents all Parameters for ItemSearch

    Less to remeber ... faster coding. Code completion combined with the right defines can make life a lot easier.

    E.g.:

    $Request = array(
    	'Operation' => AMA_OP_ITEMSEARCH,
    	'ResponseGroup' => AMA_ITEMSEARCH_RG_ITEMIDS,
    	AMA_ITEMSEARCH_PARAM_SEARCHINDEX => 'Blended',
    	AMA_ITEMSEARCH_PARAM_KEYWORDS => 'Virtually Anything',
    	AMA_ITEMSEARCH_PARAM_MINIMUMPRICE => 2500, // 25 Bucks
    	// ... so on and so forth
    );

    Rather simple ... wouldn't you say?

    Category: Amazon, PHP

    Comments are closed.