2016-01-30 13 views
5

Botoは、ほとんどのAmazon MWS APIにアクセスできますが、GetLowestPricedOffersForSKUではアクセスできません。私は1つをハックしようとしたが、それはInvalid MarketplaceIdエラーを生成します。Amazon MWSのBotoメソッドGetLowestPricedOffersForSKU

後のBotoは非常に同様の構造APIのコードを持っている - GetLowestOfferListingsForSKU:

@requires(['MarketplaceId', 'SellerSKUList']) 
@structured_lists('SellerSKUList.SellerSKU') 
@api_action('Products', 20, 5, 'GetLowestOfferListingsForSKU') 
def get_lowest_offer_listings_for_sku(self, request, response, **kw): 
    """Returns the lowest price offer listings for a specific 
     product by item condition and SellerSKUs. 
    """ 
    return self._post_request(request, kw, response) 

は、だから私はGetLowestPricedOffersForSKUにMWSの操作を変更するには@api_actionを修正:

### MINE ### 
@requires(['MarketplaceId', 'SellerSKUList']) 
@structured_lists('SellerSKUList.SellerSKU') 
@api_action('Products', 20, 5, 'GetLowestPricedOffersForSKU') 
def get_lowest_priced_offers_for_sku(self, request, response, **kw): 
    return self._post_request(request, kw, response) 

次のように私は、このメソッドを呼び出します:

conn = connection.MWSConnection(
    aws_access_key_id=ACCESS_KEY, 
    aws_secret_access_key=SECRET_KEY, 
    Merchant=ACCOUNT_ID 
) 
response = conn.get_lowest_priced_offers_for_sku(
    MarketplaceId=marketplace_id, SellerSKUList=sku_list, ItemCondition=condition 
) 

get_lowest_priced_offers_for_skuInvalid MarketplaceIdというエラーが発生します。私が行う唯一の変更がget_lowest_offer_listings_for_skuを呼び出すことです - すべての変数を同じにしておく - コードは有効な応答オブジェクトを見つけて返します。これはうまく動作します:

response = conn.get_lowest_offer_listings_for_sku(
    MarketplaceId=marketplace_id, SellerSKUList=sku_list, ItemCondition=condition 
) 

は私がのboto経由でアマゾンMWS GetLowestPricedOffersForSKUにアクセスするために行うには何が必要ですか?

答えて

0

わからないとどちらも私はPythonプログラマですが、PHP AmazonMWS APIで、私はsetMarketplaceIdを(使用場所の下のコードを使用します)

$request = new MarketplaceWebServiceProducts_Model_GetLowestPricedOffersForSKURequest(); 
$request->setSellerId($this->seller_id); 
$request->setMarketplaceId($this->marketplace_id); 
$request->setItemCondition("New"); 
関連する問題