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 9086855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:35:16+00:00 2026-06-16T21:35:16+00:00

After getting auth token with required permissions, I am trying to access user’s tasks.

  • 0

After getting auth token with required permissions, I am trying to access user’s tasks.

Request URL:

https://www.googleapis.com/tasks/v1/lists/%40default/tasks?key={YOUR_API_KEY}

Code to Make request:

    public void FetchTasks(string url)
    {
        var httpWebRequest = HttpWebRequest.CreateHttp(url);
        httpWebRequest.BeginGetResponse(new AsyncCallback(FinishedWebRequest), httpWebRequest);
    }

    private void FinishedWebRequest(IAsyncResult ar)
    {
        var httpWebRequest = ar.AsyncState as HttpWebRequest;
        var httpWebResponse = (HttpWebResponse) httpWebRequest.EndGetResponse(ar);
        byte[] responseByteArray= new byte[200];
        httpWebResponse.GetResponseStream().Read(responseByteArray, 0, responseByteArray.Length);
    }

Response

    {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

Do I need anything else as part of request headers along with auth token in the URL?

  • 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-06-16T21:35:17+00:00Added an answer on June 16, 2026 at 9:35 pm

    You need to set the Authorization HTTP header to a valid access_token for the user whose tasks you’d like to access. Assuming you’ve completed the OAuth 2.0 dance and have a valid access_token, you can set the header by changing FetchTasks() to something like this:

    public void FetchTasks(string url, string accessToken)
    {
        var httpWebRequest = HttpWebRequest.CreateHttp(url);
        request.Headers.Add("Authorization", "Bearer "+accessToken);
        httpWebRequest.BeginGetResponse(new AsyncCallback(FinishedWebRequest), httpWebRequest);
    }
    

    Also, it looks like you’re accessing the APIs using HTTP directly. Managing OAuth 2.0 tokens can be a bit cumbersome, You may want to investigate using the official Google .NET API client library which takes care of a lot of the heavy lifting for you.

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

Sidebar

Related Questions

I am getting this error when trying to access my admin panel after updating
I want to search a user from LDAP and after getting the user I
I'm trying to implement ZXing barcode scanner into my program. After getting the scanned
I want to get the profile info after getting the token <?php session_start ();
Getting authentication errors when I try and obtain my upload authorization token https://developers.google.com/youtube/2.0/developers_guide_protocol_error_responses Using
Getting this error after updating OmniAuth gem to 1.1: Started GET /users/auth/facebook for 127.0.0.1
I am using Django built in view for user login: url(r'^user/login/$', 'django.contrib.auth.views.login', {'template_name': 'users/templates/login.html'},
After getting a profile hash from the LinkedIn Ruby Gem, but I'm looking for
After getting a helpful answer here , I have run into yet another problem:
After getting a struct from C# to C++ using C++/CLI: public value struct SampleObject

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.