Can anyone spot any issue in the following code- resulting with Response [401] - no additional text...
user_token is the token returned
timespan = "[20220401..20220406]"
metrics_trafficreport = 'CLICK_THROUGH_RATE,LISTING_IMPRESSION_SEARCH_RESULTS_PAGE, LISTING_IMPRESSION_STORE,LISTING_IMPRESSION_TOTAL,LISTING_VIEWS_SOURCE_DIRECT,LISTING_VIEWS_SOURCE_OFF_EBAY,LISTING_VIEWS_SOURCE_OTHER_EBAY,LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE,LISTING_VIEWS_SOURCE_STORE,LISTING_VIEWS_TOTAL,SALES_CONVERSION_RATE,TRANSACTION'
dimension_trafficreport = 'DAY'
url_trafficreport = 'https://api.ebay.com/sell/analytics/v1/traffic_report'
querystring = {"filter":str("marketplace_ids:{EBAY_US},date_range:"+str(timespan)),
"dimension":dimension_trafficreport,
'metric':metrics_trafficreport}
headers = {
'Authorization': str('Bearer ' +str(user_token)),
"X-EBAY-C-MARKETPLACE-ID": 'EBAY_US'
}
response = requests.request("GET", url_trafficreport, headers=headers, params=querystring)