Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6982241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:15:43+00:00 2026-05-27T18:15:43+00:00

I’m learning to use google task api rest. i have succeed getting access tokken.

  • 0

I’m learning to use google task api rest.

i have succeed getting access tokken.

now i am trying to get tasklist using this rest url: https://www.googleapis.com/tasks/v1/users/@me/lists

In google task documentation write that i need to sent Access tokens by HTTP Authorization header but i don’t know how
link

i have search for result in the web but didn’t found a solution.
I have also searched this site for solution, but didn’t get one.

i am getting 401 unauthorized error in when trying to request.GetResponse();
this is my code

 private AccessToken _accessToken = null;
private string Apikey = "my api key";
protected void Page_Load(object sender, EventArgs e)
{
    _accessToken = (AccessToken)Session["AccessTokken"];
    string _customerkey = "my customer key";
    string _customerSecret = "my customer secret key";
    Response.Write(_accessToken.Token);

    string nostring = "";
    string nnString = "";
    OAuthBase oauth = new OAuthBase();
    Uri t = new Uri("https://www.googleapis.com/tasks/v1/users/@me/lists");
    string u = oauth.GenerateSignature(t, _customerkey, _customerSecret, _accessToken.Token,
                                       _accessToken.TokenSecret, "GET", oauth.GenerateTimeStamp(),
                                       oauth.GenerateNonce(), out nostring, out nnString);

    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(nostring);
    request.Method = "GET";

    //request.Headers.Add("Authorization: Bearer " + _accessToken.Token);
    WebResponse response = request.GetResponse();
    StreamReader reader = new StreamReader(response.GetResponseStream());
    string responseString = reader.ReadToEnd();
    reader.Close();


    Response.Write(responseString);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:15:43+00:00Added an answer on May 27, 2026 at 6:15 pm

    There is a Google publishes a .Net library for accessing Google Api, this includes helpers for doing the authentication I would suggest using this Api and starting from the samples the project publishers (including Task Api Sample).

    If you want to carry on hand cranking the Api call you can either just use the communications library, or look at the source code and see how Google has done the communication.

    EDIT

    From the source linked above you can find the OAuth Authenticator which adds http header System.Net.HttpRequestHeader.Authorization with the value specified in OAuthUtil.GenerateHeader. The relevant section copied below.

    StringBuilder sb = new StringBuilder();
    sb.Append("Authorization: OAuth oauth_version=\"1.0\",");
    sb.AppendFormat("oauth_nonce=\"{0}\",", EncodingPerRFC3986(nonce));
    sb.AppendFormat("oauth_timestamp=\"{0}\",", EncodingPerRFC3986(timeStamp));
    sb.AppendFormat("oauth_consumer_key=\"{0}\",", EncodingPerRFC3986(consumerKey));
    if (!String.IsNullOrEmpty(token))
    {
        sb.AppendFormat("oauth_token=\"{0}\",", EncodingPerRFC3986(
    }
    sb.Append("oauth_signature_method=\"HMAC-SHA1\",");
    sb.AppendFormat("oauth_signature=\"{0}\"", EncodingPerRFC3986(signature));
    
    return sb.ToString();
    

    You can use just this bottom layer of the Api and not worry about the generated services. Remember this code is covered by http://www.apache.org/licenses/LICENSE-2.0 so it may be easier in a legal seance to use the DLL for this specific function rather then coping it directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.