2

In nodes I am using the FB module for getting Graph API for getting insights on the page. For that i am giving request like

EX: https://graph.facebook.com/v2.2/12345_12345/insights?since=2014-12-01&until=2014-12-31

And I tried to manually hit in browser like

EX: https://graph.facebook.com/v2.2/12345_12345/insights?since=2014-12-01&until=2014-12-31&access_token=MYACCESSTOKEN

I refer following link and based on the instruction I tried some request, but I am getting only empty data even it has a data.

select date range to get insight of the page || get insights data of facebook page https://developers.facebook.com/docs/graph-api/reference/v2.2/insights https://www.facebook.com/help/336893449723054

NOTE: 12345_12345 is page.data.id value here I gave duplicate value.

Community
  • 1
  • 1
Sharathi RB
  • 867
  • 2
  • 9
  • 24

1 Answers1

2

This cannot work like this:

https://graph.facebook.com/v2.2/posts.data.id/insights?since=2014-12-01&until=2014-12-31

To build the URL out of a variable (that's what I guess you want to do), you have to contruct it like this:

var pageId = posts.data.id;
var reqUrl = 'https://graph.facebook.com/v2.2/' + pageId + '/insights?since=2014-12-01&until=2014-12-31';
...do http get request with reqUrl...
Tobi
  • 31,405
  • 8
  • 58
  • 90