eBay API, how to get numerical Site ID from SiteCodeType

一世执手 提交于 2019-12-13 02:22:54

问题


In my app I want to give the user the opportunity to choose the site to explore. What I do is showing a list of the existing sites (using a String array) and then get the SiteCodeType with the valueOf() method of the enum.

This value works with some APIs, but what I need is actually the specific ID of the site, and I can't find out how to get it. I hoped to get it somewhere using the SiteCodeType I already have.

I saw both GlobalID and SiteID but I don't understand how to work with them.

https://developer.ebay.com/DevZone/merchandising/docs/CallRef/Enums/GlobalIdList.html https://developer.ebay.com/DevZone/merchandising/docs/Concepts/SiteIDToGlobalID.html


回答1:


This utility converts between SiteCodeType and eBay numerical Site ID.

https://developer.ebay.com/DevZone/javasdk-jaxb/docs/LibRef/com/ebay/sdk/SiteIDUtil.html




回答2:


It's just a simple list with a couple dozen entries: http://developer.ebay.com/DevZone/shopping/docs/CallRef/types/SiteCodeType.html

All ya gotta do is create a simple array in your programming with a 1-to-1 mapping.



来源:https://stackoverflow.com/questions/26334468/ebay-api-how-to-get-numerical-site-id-from-sitecodetype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!