![](/img/trans.png)
[英]Ebay: Auth token is invalid. Validation of the authentication token in API request failed
[英]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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.