使用 PHP 返回 eBay API 的商店类别

Returning Store Categories with eBay API using PHP

我应该使用哪个 API 调用来 return 来自用户存储的所有类别?

我正在尝试使用 PHP。

$xml = simplexml_load_file('http://open.api.ebay.com/Shopping?callname=GetCategoryInfo&appid=$myappid&siteid=77&CategoryID=-1&version=729&IncludeSelector=ChildCategories');

但它 return 只包含 eBay 类别,不包含用户商店。

购物 API 无法检索用户商店类别。您将需要使用交易 API.

您将不得不使用 GetStore 调用。 return StoreType object 包含 StoreCustomCategoryArrayType object.

编辑:

  1. 首先您注册 eBay Developer Program.
  2. 然后得到一组钥匙from here.
  3. 您需要根据您的要求设置一些 headers,但您可以在 Making a Call.
  4. 上阅读它们
  5. 用你自己的变量替换调用。

    <?xml version="1.0" encoding="utf-8"?>
    <GetStoreRequest xmlns="urn:ebay:apis:eBLBaseComponents">
      <RequesterCredentials>
          <eBayAuthToken>$token</eBayAuthToken>
      </RequesterCredentials>
      <UserID>$userID</UserID>
      <Version>$version</Version>
    </GetStoreRequest>