Basicly what I am trying to do is to get the post impressions from a page that I am and admin for and own and from the Graph API explorer have permission to view the insights. However when i run this:
SELECT metric, value FROM insights WHERE object_id=10151215628833061 AND metric='post_impressions' AND end_time=end_time_date('2012-12-7') AND period=0
I have set the object id to equal the to the posts id and the period to 0 which is lifetime but have no success.
All i get back is this:
{
"data": [
]
}
Can not figure out whats wrong with this, does anyone know what I am doing wrong?
Your post was created yesterday, but you’re asking for metrics as of a month ago. The post didn’t exist then, so there is nothing to return.
Change your query to this:
You want to quote the object ID just in case a post you’re querying contains an underscore.