eBay 分析 API - 无效的授权
eBay Analytics API - Invalid Auth
我已经登录到 eBay 并生成了一个 Auth'n'Auth 访问令牌:
然后我在以下请求中使用了这个令牌:
$headers = array (
'Authorization: Bearer ' . $auth_token
);
$url = "https://api.ebay.com/sell/analytics/v1/traffic_report?dimension=DAY&filter=marketplace_ids:{EBAY_GB},date_range:[20160814..20160824]&metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
但是我得到以下响应:
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[errorId] => 1001
[domain] => OAuth
[category] => REQUEST
[message] => Invalid access token
[longMessage] => Invalid access token. Check the value of the Authorization HTTP request header.
)
)
)
有什么我遗漏的吗?
getTrafficReport 需要一个 oAuth 令牌,而不是 Auth'n'Auth 令牌 - https://developer.ebay.com/api-docs/sell/analytics/resources/traffic_report/methods/getTrafficReport
我已经登录到 eBay 并生成了一个 Auth'n'Auth 访问令牌:
然后我在以下请求中使用了这个令牌:
$headers = array (
'Authorization: Bearer ' . $auth_token
);
$url = "https://api.ebay.com/sell/analytics/v1/traffic_report?dimension=DAY&filter=marketplace_ids:{EBAY_GB},date_range:[20160814..20160824]&metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
但是我得到以下响应:
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[errorId] => 1001
[domain] => OAuth
[category] => REQUEST
[message] => Invalid access token
[longMessage] => Invalid access token. Check the value of the Authorization HTTP request header.
)
)
)
有什么我遗漏的吗?
getTrafficReport 需要一个 oAuth 令牌,而不是 Auth'n'Auth 令牌 - https://developer.ebay.com/api-docs/sell/analytics/resources/traffic_report/methods/getTrafficReport