eBay API, how to get numerical Site ID from SiteCo

2019-08-02 17:35发布

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

2条回答
看我几分像从前
2楼-- · 2019-08-02 17:59

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.

查看更多
【Aperson】
3楼-- · 2019-08-02 18:26

This utility converts between SiteCodeType and eBay numerical Site ID.

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

查看更多
登录 后发表回答