我应该使用哪个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类别,而不返回User Store。
Shopping API无法检索用户存储的类别。您将需要使用Trading API。
你必须使用GetStore调用。这将返回一个包含StoreCustomCategoryArrayType
对象的StoreType
对象。
- 首先你要注册eBay开发者计划。
- 然后从这里获得一组密钥。
- 你需要在你的请求上设置一些标题,但是你可以在拨打电话中阅读它们。
用自己的变量替换变量。
<?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>