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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:05:45+00:00 2026-06-01T01:05:45+00:00

I am creating Facebook application which get insights for user’s page for multiple metric.

  • 0

I am creating Facebook application which get insights for user’s page for multiple metric. Ex. for “page_active_users” and “page_active_users in one batch request.
I am using Facebook C# SDK. But not able to get data from Facebook insights (GraphAPI).

I used 5 different way to get the data but not succeed. By using Graph API method in browser shows data for a page but in batch request it returns empty array of data.

//type1

var para1 = new FacebookBatchParameter(HttpMethod.Get, "MyPageId/insights/") 
{ 
  Data = new { access_token = aToken, since = "2012-01-01", metric = "page_active_users" } 
};

//type2

    var para2 = new FacebookBatchParameter(HttpMethod.Get, "fql/", new
    {
      q = new[]{

"SELECT value,end_time FROM insights WHERE object_id=MyPageId AND metric='page_active_users' AND end_time=end_time_date('2012-01-01') AND period=86400"
           }
    }) { Data = new { access_token = aToken } };

//type 3

 var para3 = new FacebookBatchParameter().Query(
                    "SELECT value,end_time FROM insights WHERE object_id=MyPageId AND metric='page_active_users' AND end_time=end_time_date('2012-01-01') AND period=86400");

//type 4

var para4 = new FacebookBatchParameter
            {
                Path = "MyPageId/insights/",
                //Parameters = new {since = "2012-01-01"},
                Data = new { access_token = aToken, since = "2012-01-01", metric = "page_active_users" },
                HttpMethod = HttpMethod.Get
            };

//type 5

var para5 = new FacebookBatchParameter
            {
                Path = "MyPageId/insights/page_active_users?since=2012-01-01",
                //Parameters = new {since = "2012-01-01"},
                Data = new { access_token = aToken },
                HttpMethod = HttpMethod.Get
            };

//Executed all above type by passing it to below method one by one.But always return empty data array while data is exists on Facebook which I tested using Grap API tool.

var result = client.Batch(para1-5);

Any help appreciated.
Thanks in advanced.
Dharmendra Mistry

  • 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-01T01:05:47+00:00Added an answer on June 1, 2026 at 1:05 am

    I found solution on my own. Hope this will help someone. Here is the solution.

    ///I created an enum for list of metrics that facebook is providing
    public enum FacebookMatricType
    {
            page_active_users,
            page_active_users_locale
    }
    
    //Created a list of Facebook batch request for each metric using LINQ to Object and //concatenate string using string.format method.
    
    var batchParameters = (from FacebookMatricType matricType in Enum.GetValues(typeof (FacebookMatricType))
                                       select new object[]
                                                  {
                                                     pPageAccessToken,"insights",matricType.ToString(),pFromDate.Date.ToString("yyyy-MM-dd"),pPageId
                                                  }
                                       into objectParamter
                                       select new FacebookBatchParameter
                                                  {
                                                      HttpMethod = HttpMethod.Get,
                                                      Path =
                                                          string.Format(
                                                              "https://graph.facebook.com/{0}/{1}/{2}?since={3}&access_token={4}",
                                                              objectParamter)
                                                  }).ToList();
    
    //Once I get the list of request I execute it using facebook web client using C# SDK.
    
    var facebookClient = new FacebookClient(pProfileAccessToken);
    var results = facebookClient.Batch(batchParameters.ToArray()); 
    //Results are ready to deserialize.
    

    Thank you. 😉
    Dharmendra Mistry

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

Sidebar

Related Questions

i am creating a facebook application which lets user to upload photo through html
I am creating a Facebook application which should allow the user do post something
I'm creating an ASP.NET application which uses Facebook Connect and fbml tags. It also
I am creating a poll script for a facebook fan page: http://www.facebook.com/apps/application.php?id=115400635147687&v=app_115400635147687 I am
I am creating an application which uses the facebook api, and I want facebook
I'm creating an application in SproutCore, which I want to integrate with Facebook. To
I am creating a Facebook fan-gate that when a user likes my page it
I am trying to create an application like Facebook in which each user can
Goal: Allow a user to authentication with Facebook into an iOS application which requires
I am creating an application in which I am trying to add Facebook account

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.