【问题标题】:Returning Store Categories with eBay API using PHP使用 PHP 使用 eBay API 返回商店类别
【发布时间】:2023-03-19 10:43:02
【问题描述】:

我应该使用哪个 API 调用从用户存储中返回所有类别?

我正在尝试使用 PHP。

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

但它只返回 eBay 类别,而不是用户商店。

【问题讨论】:

    标签: php ebay-api


    【解决方案1】:

    购物 API 无法检索用户存储类别。您将需要使用交易 API。

    您必须使用 GetStore 调用。这将返回一个包含StoreCustomCategoryArrayType 对象的StoreType 对象。

    编辑:

    1. 首先您注册eBay Developer Program.
    2. 然后得到一组密钥from here.
    3. 您需要在请求中设置一些标头,但您可以在Making a Call. 阅读有关它们的信息
    4. 用您自己的变量替换变量。

      <?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>
      

    【讨论】:

    • 我现在明白了,你能给我写一个 GetStore 调用类型的有效调用吗?在 Ebay Api 开发页面中,我找不到任何示例
    • 您还必须使用不同的端点:api.sandbox.ebay.com/ws/api.dll
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多