当试图使用https://api.ebay.com/sell/inventory/v1/offer/OFFER_ID端点获取优惠信息时,我需要帮助理解令牌问题。Ebay getOffer API令牌问题
我有2种令牌: 用户令牌和访问令牌。
文档清楚地给了我必须使用USER TOKEN的解释。 我使用Auth'n'Auth方法制作它,我同意作为卖家提供许可。现在我想使用此令牌这样的:
public void getOffer(@RequestBody Map<String, String> args) throws IOException {
HttpClient client = HttpClientBuilder.create().build();
HttpGet httpGet = new HttpGet("https://api.ebay.com/sell/inventory/v1/offer/OFFER_ID");
httpGet.setHeader("Authorization", "Bearer " + args.get("token"));
httpGet.setHeader("Content-Language", "en-US");
HttpResponse response = client.execute(httpGet);
System.out.print(EntityUtils.toString(response.getEntity()));
}
它让我回: { "errors" : [ { "errorId" : 1001, "domain" : "OAuth", "category" : "REQUEST", "message" : "Invalid access token", "longMessage" : "Invalid access token. Check the value of the Authorization HTTP request header." } ] }
什么可能是错误的,我错过了什么措施? 预先感谢您