Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP中使用AmazonAPI列出根浏览器节点(类别)和子浏览器节点(子类别)_Php_Api_Amazon Web Services - Fatal编程技术网

在PHP中使用AmazonAPI列出根浏览器节点(类别)和子浏览器节点(子类别)

在PHP中使用AmazonAPI列出根浏览器节点(类别)和子浏览器节点(子类别),php,api,amazon-web-services,Php,Api,Amazon Web Services,我正在PHP中使用亚马逊API。 我需要列出产品的类别(根浏览器节点) Ex. men fashion women fashion kitchen baby&kids 因此,我们无法找到解决方案 产品的搜索功能运行良好 我已经为搜索产品包含了这些文件: amazon_api_class.php、aws_signed_request.php public function searchProducts($search, $category, $searchType

我正在PHP中使用亚马逊API。

我需要列出产品的类别(根浏览器节点

Ex. men fashion    women fashion     kitchen     baby&kids
因此,我们无法找到解决方案

产品的搜索功能运行良好

我已经为搜索产品包含了这些文件:
amazon_api_class.php、aws_signed_request.php

public function searchProducts($search, $category, $searchType = "UPC")
    {
        $allowedTypes = array("UPC", "TITLE", "ARTIST", "KEYWORD");
        $allowedCategories = array("Music", "DVD", "VideoGames", "Apparel", "Automotive", "Baby" ,"Beauty",  "Books",  
                "Classical",  "DigitalMusic",  "Electronics",  "HealthPersonalCare",  "HomeGarden",  "Industrial",  "Jewelry",  
                "Kitchen",  "Magazines",  "Miscellaneous",  "OfficeProducts",  "Video", "Watches");

        switch($searchType) 
        {
            case "UPC" :    $parameters = array("Operation"     => "ItemLookup",
                                                "ItemId"        => $search,
                                                "SearchIndex"   => $category,
                                                "IdType"        => "UPC",
                                                "ResponseGroup" => "Medium");
                            break;

            case "TITLE" :  $parameters = array("Operation"     => "ItemSearch",
                                                "Title"         => $search,
                                                "SearchIndex"   => $category,
                                                "ResponseGroup" => "Medium");
                            break;


        }


        $xml_response = $this->queryAmazon($parameters);


        return $this->verifyXmlResponse($xml_response);

    } 
我正在使用以下函数获取搜索结果

文件名:amazon\u api\u class.php

public function searchProducts($search, $category, $searchType = "UPC")
    {
        $allowedTypes = array("UPC", "TITLE", "ARTIST", "KEYWORD");
        $allowedCategories = array("Music", "DVD", "VideoGames", "Apparel", "Automotive", "Baby" ,"Beauty",  "Books",  
                "Classical",  "DigitalMusic",  "Electronics",  "HealthPersonalCare",  "HomeGarden",  "Industrial",  "Jewelry",  
                "Kitchen",  "Magazines",  "Miscellaneous",  "OfficeProducts",  "Video", "Watches");

        switch($searchType) 
        {
            case "UPC" :    $parameters = array("Operation"     => "ItemLookup",
                                                "ItemId"        => $search,
                                                "SearchIndex"   => $category,
                                                "IdType"        => "UPC",
                                                "ResponseGroup" => "Medium");
                            break;

            case "TITLE" :  $parameters = array("Operation"     => "ItemSearch",
                                                "Title"         => $search,
                                                "SearchIndex"   => $category,
                                                "ResponseGroup" => "Medium");
                            break;


        }


        $xml_response = $this->queryAmazon($parameters);


        return $this->verifyXmlResponse($xml_response);

    } 
现在我正在寻找这样一个函数,它将在xml响应中提供可用的类别