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

  • Home
  • SEARCH
  • 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 7764499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:55:39+00:00 2026-06-01T14:55:39+00:00

string accessToken = GetAccessToken(); string accessKey = accessToken.Split(‘=’)[1]; var client = new FacebookClient(accessKey); dynamic

  • 0
        string accessToken = GetAccessToken();
        string accessKey = accessToken.Split('=')[1];

        var client = new FacebookClient(accessKey);
        dynamic me = client.Get("me");

here is the method to get access token and it does return a valid access token

private static string GetAccessToken()
    {
        // Create a request using a URL that can receive a post. 
        WebRequest request = WebRequest.Create("https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=201193246663533&client_secret=secretkeyhere");
        // Set the Method property of the request to POST.
        request.Method = "POST";
        // Create POST data and convert it to a byte array.
        string postData = "This is a test that posts this string to a Web server.";
        byte[] byteArray = Encoding.UTF8.GetBytes(postData);
        // Set the ContentType property of the WebRequest.
        request.ContentType = "application/x-www-form-urlencoded";
        // Set the ContentLength property of the WebRequest.
        request.ContentLength = byteArray.Length;
        // Get the request stream.
        Stream dataStream = request.GetRequestStream();
        // Write the data to the request stream.
        dataStream.Write(byteArray, 0, byteArray.Length);
        // Close the Stream object.
        dataStream.Close();
        // Get the response.
        WebResponse response = request.GetResponse();
        // Display the status.
        Console.WriteLine(((HttpWebResponse)response).StatusDescription);
        // Get the stream containing content returned by the server.
        dataStream = response.GetResponseStream();
        // Open the stream using a StreamReader for easy access.
        StreamReader reader = new StreamReader(dataStream);
        // Read the content.
        string responseFromServer = reader.ReadToEnd();
        // Display the content.
        Console.WriteLine(responseFromServer);
        // Clean up the streams.
        reader.Close();
        dataStream.Close();
        response.Close();

        return responseFromServer;
    }

However, when I debug over

dynamic me = client.Get("me");

throws this exception:

(OAuthException – #2500) An active access token must be used to query information about the current user.

How can i fix this?

  • 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-01T14:55:41+00:00Added an answer on June 1, 2026 at 2:55 pm

    you are getting access token for the APPLICATION, not for a user. Therefore, “me” does not make sense. You should supply ID there – either your user ID, or your app ID, or any other ID your app has permissions for.

    both calls worked for with your example:

    dynamic me = client.Get("1000<<MY_USER_ID>>5735");
    
    dynamic theApp = client.Get("201193246663533");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

String[] a = c.toArray(new String[0]); First: Do I need type cast here? (I think
string exeFile = (new System.Uri(Assembly.GetEntryAssembly().CodeBase)).AbsolutePath; string exeDir = Path.GetDirectoryName(exeFile); string fileName = Path.Combine(exeDir, @..\..\xml\SalesOrderXMLData.csv.xml);
Using DotNetOpenAuth 3.4.3.10103 when i call: public static XDocument GetUpdates(ConsumerBase twitter, string accessToken) {
Here is the code I am using to get Facebook friend list, the class
I tried this: oAuthClient = new FacebookOAuthClient(FacebookApplication.Current); oAuthClient.RedirectUri = callBack; var parameters = new
public class FacebookConnect extends Activity { Facebook facebook = new Facebook(); String FILENAME =
String processing in C# and VB.NET is easy for me, but understanding how to
String s1 = The quick brown fox jumps over the lazy dog; String s2
string.insert in c# doesn't overwrite the character that is in the startindex does it?
String contains a bunch of useful methods such as String.replace(CharSequence, CharSequence) that are completely

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.