Services_Amazon
[ class tree: Services_Amazon ] [ index: Services_Amazon ] [ all elements ]

Class: Services_AmazonECS4

Source Location: /Services_Amazon-0.3.0/AmazonECS4.php

Class Overview


Class for accessing and retrieving information from Amazon's Web Services


Author(s):

Version:

  • Release: @package_version@

Methods


Inherited Variables

Inherited Methods


Class Details

[line 98]
Class for accessing and retrieving information from Amazon's Web Services
  • Author: John Downey <jdowney@gmail.com>
  • Author: Tatsuya Tsuruoka <ttsuruoka@p4life.jp>
  • Version: Release: @package_version@
  • Access: public
  • Uses: XML_Unserializer
  • Uses: HTTP_Request
  • Uses: PEAR


[ Top ]


Method Detail

Services_AmazonECS4 (Constructor)   [line 159]

Services_AmazonECS4 Services_AmazonECS4( string $subid, [string $associd = null])

Constructor

Parameters:

string   $subid   —  An Amazon Subscription ID used when quering Amazon servers
string   $associd   —  An Amazon Associate ID used in the URL's so a commision may be payed

[ Top ]

BrowseNodeLookup   [line 289]

array BrowseNodeLookup( string $browsenode_id, [array $options = array()])

Retrieves information about a browse node

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $result $amazon->BrowseNodeLookup('283155')// 283155='Books'
  4.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $browsenode_id   —  The browse node ID
array   $options   —  The optional parameters

[ Top ]

CartAdd   [line 320]

array CartAdd( string $cart_id, string $hmac, array $item, [array $options = array()])

Adds items to an existing remote shopping cart

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $item = array('ASIN' => 'aaaaaaaaaa''Quantity' => 1);
  4.  // $item = array(array('ASIN' => 'aaaaaaaaaa', 'Quantity' => 1),
  5.  //               array('OfferListingId' => 'bbbbbbbbbb', 'Quantity' => 10),
  6.  //               array('ASIN' => 'cccccccccc', 'Quantity' => 20));
  7.  $result $amazon->CartAdd('[Cart ID]''[HMAC]'$item);
  8.  ?>


Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $item   —  Products and the quantities
array   $options   —  The optional parameters

[ Top ]

CartClear   [line 340]

array CartClear( string $cart_id, string $hmac, [array $options = array()])

Removes all the contents of a remote shopping cart

Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $options   —  The optional parameters

[ Top ]

CartCreate   [line 369]

array CartCreate( array $item, [array $options = array()])

Creates a new remote shopping cart

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $item = array('ASIN' => 'aaaaaaaaaa''Quantity' => 1);
  4.  // $item = array(array('ASIN' => 'aaaaaaaaaa', 'Quantity' => 1),
  5.  //               array('ASIN' => 'cccccccccc', 'Quantity' => 20));
  6.  $result $amazon->CartCreate($item);
  7.  ?>


Parameters:

array   $item   —  Products and the quantities
array   $options   —  The optional parameters

[ Top ]

CartGet   [line 387]

array CartGet( string $cart_id, string $hmac, [array $options = array()])

Retrieves the contents of a remote shopping cart

Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $options   —  The optional parameters

[ Top ]

CartModify   [line 419]

array CartModify( string $cart_id, string $hmac, array $item, [array $options = array()])

Modifies the quantity of items in a cart and changes cart items to saved items

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $item = array('CartItemId' => 'aaaaaaaaaa''Quantity' => 1);
  4.  // $item = array('CartItemId' => 'aaaaaaaaaa', 'Action' => 'SaveForLater');
  5.  // $item = array(array('CartItemId' => 'aaaaaaaaaa', 'Quantity' => 1),
  6.  //               array('CartItemId' => 'cccccccccc', 'Quantity' => 20));
  7.  $result $amazon->CartModify('[Cart ID]''[HMAC]'$item);
  8.  ?>


Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $item   —  The CartItemId and the quantities or the Action
array   $options   —  The optional parameters

[ Top ]

CustomerContentLookup   [line 438]

array CustomerContentLookup( string $customer_id, [array $options = array()])

Retrieves publicly available content written by specific Amazon customers

Parameters:

string   $customer_id   —  A customer ID
array   $options   —  The optional parameters

[ Top ]

CustomerContentSearch   [line 455]

array CustomerContentSearch( [array $customer = null], [array $options = array()])

Searches for Amazon customers by name or email address

Parameters:

array   $customer   —  A customer's name or its email
array   $options   —  The optional parameters

[ Top ]

doBatch   [line 707]

array doBatch( string $operation, array $shared, array $params1, array $params2)

Combines requests for the same operation into a single request

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $shared = array('SearchIndex' => 'Books',
  4.                  'Keywords' => 'php');
  5.  $params1 = array('ItemPage' => '1');
  6.  $params2 = array('ItemPage' => '2');
  7.  $result $amazon->doBatch('ItemSearch'$shared$params1$params2);
  8.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $operation   —  The operation
array   $shared   —  Shared parameters
array   $params1   —  The parameters specific to the first request
array   $params2   —  The parameters specific to the second request

[ Top ]

doMultiOperation   [line 745]

array doMultiOperation( string $operation1, array $params1, string $operation2, array $params2)

Combines the different operations into a single request

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $params1 = array('SearchIndex' => 'Books',
  4.                   'Title' => 'sushi');
  5.  $params2 = array('Keywords' => 'tempura');
  6.  $result $amazon->doMultiOperation('ItemSearch'$params1,
  7.                                      'SellerListingSearch'$params2);
  8.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $operation1   —  The first operation
array   $params1   —  The parameters specific to the first request
string   $operation2   —  The second operation
array   $params2   —  The parameters specific to the second request

[ Top ]

getApiVersion   [line 172]

string getApiVersion( )

Retrieves the current version of this classes API
  • Return: The API version
  • Access: public

[ Top ]

getLastUrl   [line 267]

string getLastUrl( )

Retrieves the last URL accessed to the Amazon (for debugging)
  • Return: The Last URL
  • Access: public

[ Top ]

getProcessingTime   [line 256]

string getProcessingTime( )

Retrieves the processing time
  • Return: Processing time
  • Access: public

[ Top ]

Help   [line 480]

array Help( string $help_type, string $about, [array $options = array()])

Retrieves information about operations and response groups

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $result $amazon->Help('Operation''ItemLookup');
  4.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $help_type   —  The type of information
string   $about   —  The name of an operation or a response group
array   $options   —  The optional parameters

[ Top ]

ItemLookup   [line 508]

array ItemLookup( string $item_id, [array $options = array()])

Retrieves information for products

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $options = array();
  4.  $options['ResponseGroup''Large';
  5.  $result $amazon->ItemLookup('[ASIN(s)]'$options);
  6.  ?>


Parameters:

string   $item_id   —  Product IDs
array   $options   —  The optional parameters

[ Top ]

ItemSearch   [line 537]

array ItemSearch( string $search_index, [array $options = array()])

Searches for products

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $options = array();
  4.  $options['Keywords''sushi';
  5.  $options['Sort''salesrank';
  6.  $options['ResponseGroup''ItemIds,ItemAttributes,Images';
  7.  $result $amazon->ItemSearch('Books'$options);
  8.  ?>


Parameters:

string   $search_index   —  A search index
array   $options   —  The optional parameters

[ Top ]

ListLookup   [line 555]

array ListLookup( string $list_type, string $list_id, [array $options = array()])

Retrieves products in a specific list

Parameters:

string   $list_type   —  The type of list
string   $list_id   —  A list ID
array   $options   —  The optional parameters

[ Top ]

ListSearch   [line 583]

array ListSearch( string $list_type, array $keywords, [array $options = array()])

Searches for a wish list, baby registry, or wedding registry

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $keywords = array('Name' => 'hoge');
  4.  $result $amazon->ListSearch('WishList'$keywords);
  5.  ?>


Parameters:

string   $list_type   —  The type of list
array   $keywords   —  Parameters to search for
array   $options   —  The optional parameters

[ Top ]

SellerListingLookup   [line 602]

array SellerListingLookup( string $id_type, string $id, [array $options = array()])

Retrieves information about Amazon zShops and Marketplace products

Parameters:

string   $id_type   —  The type of ID
string   $id   —  The exchange ID or the listing ID
array   $options   —  The optional parameters

[ Top ]

SellerListingSearch   [line 629]

array SellerListingSearch( string $search_index, [array $options = array()])

Searches for Amazon zShops and Marketplace products

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $keywords = array('Keywords' => 'pizza');
  4.  $result $amazon->SellerListingSearch('zShops'$keywords);
  5.  ?>


Parameters:

string   $search_index   —  The type of seller listings
array   $options   —  The optional parameters

[ Top ]

SellerLookup   [line 645]

array SellerLookup( string $seller_id, [array $options = array()])

Retrieves information about specific sellers
  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $seller_id   —  IDs for Amazon sellers
array   $options   —  The optional parameters

[ Top ]

setAssociateID   [line 196]

void setAssociateID( string $associd)

Sets an Associate ID
  • Access: public

Parameters:

string   $associd   —  An Associate ID

[ Top ]

setBaseUrl   [line 208]

void setBaseUrl( string $url)

Sets the base URL
  • Access: public

Parameters:

string   $url   —  The base url

[ Top ]

setLocale   [line 222]

mixed setLocale( string $locale)

Sets the locale passed when making a query to Amazon

Currently US, UK, DE, JP, FR, and CA are supported

  • Return: A PEAR_Error on error, a true on success
  • Access: public

Parameters:

string   $locale   —  The new locale to use

[ Top ]

setSubscriptionID   [line 184]

void setSubscriptionID( string $subid)

Sets a Subscription ID
  • Access: public

Parameters:

string   $subid   —  A Subscription ID

[ Top ]

setVersion   [line 245]

void setVersion( string $version)

Sets a version
  • Access: public

Parameters:

string   $version   —  A service version

[ Top ]

SimilarityLookup   [line 661]

array SimilarityLookup( string $item_id, [array $options = array()])

Retrieves products that are similar to Amazon products
  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $item_id   —  Product IDs
array   $options   —  The optional parameters

[ Top ]

TransactionLookup   [line 677]

array TransactionLookup( string $transaction_id, [array $options = array()])

Retrieves information about the status of financial transactions
  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $transaction_id   —  Transaction IDs
array   $options   —  The optional parameters

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:13:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.