Amazon GetMatchingProductForId API不返回产品信息

时间:2013-05-11 13:10:22

标签: amazon-web-services

AWS API GetMatchingProductForId应返回与输入匹配的product-id的“AttributeSets”列表 但是,我们收到“ItemAttributes”的空值。 我正在调用API,如下所述 -

  1. 创建MarketplaceWebServiceProducts类的实例。此类在AWS的“com.amazonservices.mws.products”包中提供,位于“mws-products-1.0.jar”
  2. 创建Request'GetMatchingProductForIdRequest'的实例并为其设置所需的参数,如下所示 -

    GetMatchingProductForIdRequest request = new GetMatchingProductForIdRequest(); request.setSellerId(MERCHANTID); request.setIdType( “ASIN”); request.setMarketplaceId(marketPlaceId); IdListType idListType = new IdListType(); idListType.setId(IDLIST); request.setIdList(idListType);

  3. 3.使用上面创建的请求调用API -

    response = marketplaceWebServiceProducts.getMatchingProductForId(productRequest);
    
    1. 收到回复,HTTP状态代码为200(成功)。但是将AttributeSets设为null
    2. 我也通过设置从亚马逊网站找到的硬编码产品ID(ASIN:B007VCRRNS)进行测试。

3 个答案:

答案 0 :(得分:0)

来自亚马逊的回答: 感谢您联系MWS支持。我已经与我们的内部团队核实了这一点,发现我们不再在API中公开功能数据。我们只是将其作为空白返回,以避免破坏任何现有的集成。

答案 1 :(得分:-1)

$serviceUrl = "https://mws.amazonservices.co.uk/Products/2011-10-01";

$config = array (
    'ServiceURL' => $serviceUrl,
    'ProxyHost' => null,
    'ProxyPort' => -1,
    'MaxErrorRetry' => 3,
);

$service = new MarketplaceWebServiceProducts_Client(
    AWS_ACCESS_KEY_ID,
    AWS_SECRET_ACCESS_KEY,
    APPLICATION_NAME,
    APPLICATION_VERSION,
    $config
);

$request = new MarketplaceWebServiceProducts_Model_GetMatchingProductForIdRequest();
$request->setSellerId(MERCHANT_ID);
$request->setMarketplaceId("A1F83G8C2ARO7P");
$request->setIdType("ASIN");
$idlist = new MarketplaceWebServiceProducts_Model_IdListType();
$idlist->setId("B00BNBA6CC");
$request->SetIdList($idlist);

$response = $service->GetMatchingProductForId($request);

答案 2 :(得分:-1)

function GetMatchingProduct(Request $form_request){
    $errormsg = array();
    $result = false;
    $products = array();
    $config = array (
        'ServiceURL'=>PRODUCT_URL,
        'ProxyHost'=>null,
        'ProxyPort'=>-1,
        'ProxyUsername'=>null,
        'ProxyPassword'=>null,
        'MaxErrorRetry'=>3
    );
    $service= new \MarketplaceWebServiceProducts_Client(
        AWS_ACCESS_KEY_ID,
        AWS_SECRET_ACCESS_KEY,
        APPLICATION_NAME,
        APPLICATION_VERSION,
        $config
    );


        $asin_list= new \MarketplaceWebServiceProducts_Model_ASINListType();
        $asin_list->setASIN(array('B00DAH1IC4', 'B01274KVYE'));
        $request=new \MarketplaceWebServiceProducts_Model_GetMatchingProductRequest();
        $request->setSellerID(MERCHANT_ID);
        $request->setMarketplaceId(MARKETPLACE_ID);
        $request->setASINList($asin_list);
    try{
        $response = $service->GetMatchingProduct($request); 
        $products = new \SimpleXMLElement($response->toXML());
    }catch(\MarketplaceWebServiceProducts_Exception $ex){
        array_push($errormsg,$ex->getMessage());
    }
    return response()->json(array('errormsg'=>$errormsg,'products'=>$products,'result'=>$result));
}