Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 易趣分析api获取流量报告返回远程服务器返回错误:(400)请求错误_C#_Analytics_Ebay Api_Bad Request - Fatal编程技术网

C# 易趣分析api获取流量报告返回远程服务器返回错误:(400)请求错误

C# 易趣分析api获取流量报告返回远程服务器返回错误:(400)请求错误,c#,analytics,ebay-api,bad-request,C#,Analytics,Ebay Api,Bad Request,嗨,我正在使用易趣分析api。我正在尝试获取易趣挂牌印象,但我的代码返回远程服务器返回错误:(400)请求错误。我试了很多次,但都没能解决这个问题。 我的代码如下: string response1 = ""; string response2 = ""; try { string url = ""; url += "https://api.ebay.com/sell/analytics/v1/traffic_report?"; url += "filter=marketp

嗨,我正在使用易趣分析api。我正在尝试获取易趣挂牌印象,但我的代码返回远程服务器返回错误:(400)请求错误。我试了很多次,但都没能解决这个问题。 我的代码如下:

string response1 = "";
string response2 = "";
try
  {
   string url = "";
   url += "https://api.ebay.com/sell/analytics/v1/traffic_report?";
   url += "filter=marketplace_ids:%7BEBAY_US%7D,";
   url += "listing_ids:%7Bxxxxxxxxxxxxx%7D,";
   url += "date_range:%5B20170201..20170227%5D&";
   url += "dimension=LISTING&";
   url += "metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE,SALES_CONVERSION_RATE&";
  url += "sort=LISTING_IMPRESSION_STORE";

 HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);     httpWebRequest.Method = "GET";
 httpWebRequest.ContentType = "application/json; charset=utf-8";
 HttpWebResponse httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
 response1 = "StatusCode:"+httpResponse.StatusCode + ",StatusDescription:" + httpResponse.StatusDescription + ",ResponseUri:" + httpResponse.ResponseUri;
}
catch (Exception ex)
{
  response2 = "Message:" + ex.Message;

}
string resp = response1 + "==" + response2;
url“XXXXXXXXX”是我的产品项目ID

请告诉我确切的原因是什么。 请任何人帮助我。 我在等待解决办法


谢谢…

您是否尝试在浏览器中运行url?是的,我也尝试过。但是返回响应{“errors”:[{“errorId”:1002,“domain”:“OAuth”,“category”:“REQUEST”,“message”:“Missing access token”,“longMessage”:“access token在授权HTTP请求头中丢失。”}]}