The remote server returned an error: (404) Not Found. google implentation in c#
<p>I'm using OAuth2 credentials, getting 404 error:</p>

<pre><code>using Google.Analytics;
using Google.GData.Analytics;

    void Analytics()
        {
            try
            {
                string userName = ConfigurationManager.AppSettings["username"];
                string passWord = ConfigurationManager.AppSettings["password"];
                string gkey = "key=api _key";
                string dataFeedUrl = "https://www.googleapis.com/analytics/v3/data/ga";//+ gkey;
                AccountQuery query = new AccountQuery();
                AnalyticsService service = new AnalyticsService("Web App");
                service.setUserCredentials(userName, passWord);

                DataQuery query1 = new DataQuery(dataFeedUrl);
                query1.Ids = "ga:123456789";
                query1.Metrics = "ga:visits,ga:sessions,ga:pageValue,ga:bounces,ga:bounceRate,ga:pageviews";
                query1.Dimensions = "ga:city,ga:date";
                query1.GAStartDate = ("2016-03-15");//DateTime.Now.AddMonths(-1).AddDays(-2).ToString("yyyy-MM-dd");
                query1.GAEndDate = ("2016-03-17");//DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd");
                query1.ExtraParameters = gkey;
                DataFeed dataFeedVisits = service.Query(query1);
                foreach (DataEntry entry in dataFeedVisits.Entries)
                {
                    string st = entry.Title.Text;
                    string ss = entry.Metrics[0].Value;
                    int _intVisists = Int32.Parse(ss);
                    Response.Write("&lt;br/&gt;");
                    Response.Write("Total Visits : " + ss);
                    Response.Write("&lt;br/&gt;");
                }
            }
            catch (Exception ex)
            {
                Response.Write("Error : " + ex);
            }
        }
</code></pre>

<p>Exception is : </p>

<blockquote>
  <p>Execution of request failed: <a href="https://www.googleapis.com/analytics/v3/data/ga?key=api_key&amp;dimensions=ga:city,ga:date&amp;end-date=2016-03-17&amp;ids=ga:123456789&amp;metrics=ga:visits,ga:sessions,ga:pageValue,ga:bounces,ga:bounceRate,ga:pageviews&amp;start-date=2016-03-15" rel="nofollow noreferrer">https://www.googleapis.com/analytics/v3/data/ga?key=api_key&amp;dimensions=ga:city,ga:date&amp;end-date=2016-03-17&amp;ids=ga:123456789&amp;metrics=ga:visits,ga:sessions,ga:pageValue,ga:bounces,ga:bounceRate,ga:pageviews&amp;start-date=2016-03-15</a></p>
</blockquote>

<p>Somehow its redirecting to <a href="https://www.google.com/accounts/ClientLogin" rel="nofollow noreferrer">https://www.google.com/accounts/ClientLogin</a> which is shutdown by google.</p>