是否有API可以获取相同级别的类别?

时间:2019-07-01 11:26:03

标签: php ebay-api

我是eBay API的新手。我为获得相同级别的类别而感到震惊。我正在使用getCategoriesInfo(购物)API来获取类别,但找不到任何方法来获取相同级别的类别。

public function getCategories(int $categoryId = -1): Shopping\Types\GetCategoryInfoResponseType
{
    $service_params = $this->getServiceParams();

    $service_params[ 'siteId' ] = self::SITEIDS[ Cookie::get('GLOBAL-ID') ];
    $service                    = new Shopping\Services\ShoppingService($service_params);
    /**
     * Create the request object.
     */
    $request = new Shopping\Types\GetCategoryInfoRequestType();

    $request->CategoryID      = (string)$categoryId;
    $request->IncludeSelector = 'ChildCategories';

    /**
     * Send the request.
     */
    return $response = $service->getCategoryInfo($request);
}

1 个答案:

答案 0 :(得分:0)

要获得相同级别的类别,您需要指定父类别并请求子猫。