使用PHP通过eBay API返回商店类别 [英] Returning Store Categories with eBay API using PHP

查看:268
本文介绍了使用PHP通过eBay API返回商店类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用哪个API调用来从User Store返回所有类别?

Which API call should I use to return all categories from User Store?

我正在尝试使用PHP。

I'm trying to do it with PHP.

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

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

But it's returning only the eBay categories, not the User Store.

推荐答案

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

The Shopping API cannot retrieve a users store categories. You will need to use the Trading API.

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

You would have to use the GetStore call. Which would return a StoreType object containing a StoreCustomCategoryArrayType object.

编辑:


  1. 首先,您注册 eBay开发人员计划。

  2. 然后获得一组密钥从这里开始。

  3. 您将需要在请求中设置一些标头,但您可以阅读有关在拨打电话上

  4. 使用自己的变量进行调用。

  1. First you sign up to the eBay Developer Program.
  2. Then get a set of keys from here.
  3. You will need to set some headers on your request but you can read about them at Making a Call.
  4. Make the call replacing the variables with your own.

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


这篇关于使用PHP通过eBay API返回商店类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆