Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 544.3k

Error - Request Url not found

Apr 20 2024 3:39 PM

Hi

   I am getting this error - The requested URL <code>/youtube/analytics/v1/reports/query</code> was not found on this server.  <ins>That’s all we know.</ins>

Below is the code

public void TrafficSearch()
        {

            var videoIds = new List<string>();

            var client = new RestClient("googleapis.com/youtube/analytics/v1/reports");
            var request = new RestRequest("query", Method.GET);

            request.AddParameter("channelId", "UCg3ZpKSH76ngG-m_nNVw");

            request.AddParameter("metrics", "views");
            request.AddParameter("dimensions", "insightTrafficSourceType,insightTrafficSourceDetail");
            request.AddParameter("key", "AIzaSKSHGDTSGSFTRSG8");
            request.AddParameter("type", "video");
            request.AddParameter("maxResults", "50");
            do
            {
                try
                {
                    var videoListResponse = client.Execute(request);
                    Console.WriteLine(videoListResponse.Content);
                    dynamic videoListData = JsonConvert.DeserializeObject(videoListResponse.Content);

                    foreach (var item in videoListData.items)
                    {
                        videoIds.Add(item.id.videoId.ToString());
                    }
}
}
}

Thanks


Answers (2)