Get the post's text using Graph Api Explorer - facebook-graph-api

I want to get the post's text using the post ID using Graph Api query at Graph Api Explorer. I am trying as;
GET/v2.8/{14346289902472_1788429604532785}
and
GET/v2.8/{14346289902472_1788429604532785} HTTP1.1
as documentation says;
But both prompts errors;
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: {14346289902472_1788429604532785}",
"type": "OAuthException",
"code": 803,
"fbtrace_id": "AKd65t6sFzI"
}
}
and
{
"error": {
"message": "Unknown path components: /1.1",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "DbFPezM2JiA"
}
}
How can I get the post text using post ID?
Edit 1

Where did you get that id from in the first place?
Visiting https://www.facebook.com/14346289902472_1788429604532785 redirects to https://www.facebook.com/ImranKhanOfficial/posts/1788429604532785, and when you look up the page name ImranKhanOfficial via API, you find its page id is 143462899029472.
So
14346289902472
instead of
143462899029472
And once you use that as the “prefix” for the post id, it works perfectly fine: https://developers.facebook.com/tools/explorer?method=GET&path=143462899029472_1788429604532785&version=v2.8

You are trying to get a single feed item.
GET https://graph.facebook.com/v2.8/143462899029472/feed?id=1788429604532785
{
"error": {
"message": "(#12) singular statuses API is deprecated for versions v2.4 and higher",
"type": "OAuthException",
"code": 12,
"fbtrace_id": "CJpKkf7emZS"
}
}
Graph api does not allow you to do this.
Just get the feed GET https://graph.facebook.com/v2.8/143462899029472/feed and iterate over the results until you find the one you want. If you don't find it in the first set, then paginate and get it in the next set.

Related

Graph API error param data must be an array

I am trying to load some data to facebook offline events using graph API explorer but ends up with error:
{"error": {
"message": "(#100) param data must be an array.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Arug9LHzE4FKTY67LrqQZiJ"
}
}
My data is already in array format.

How to get insights of the instagram's post?

I want to get the insights of Instagram's post using media-id. From the URL e.g https://www.instagram.com/p/BWxFy1hHbzz I got the media-id "1563056029344578803" and owner-id "1371714791". But I could not fetch the insights as per the documentation i.e https://developers.facebook.com/docs/instagram-api/guides/insights/. I am getting the response like
{ "error": { "message": "(#803) Some of the aliases you requested do not exist: 1563056029344578803", "type": "OAuthException", "code": 803, "fbtrace_id": "A16zgltTT2GbwICaeMXkIJT" } }
GET https://graph.facebook.com/v9.0/1563056029344578803/insights?access_token=XXXXX&metric=follower_count,impressions,profile_views,reach&period=day
I have followed everything as per the documentation. Please give the follow-up for this issue.

error with searching Facebook Graph API user search

i want to user Facebook graph api to search for user information
but i get an Error when i write
GET graph.facebook.com/v3.3/search?q=java&type=user
{
"error": {
"message": "Unsupported operation",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "GLFKEUeypcH"
}
}
https://developers.facebook.com/docs/graph-api/advanced#search lists the available search types - those are place, placetopic, and several ad_* searches for targeting purposes.
You can not search for users any more.

Facebook page posts insights, and links using graph api

I'm trying to get insights for all the posts from one of my facebook pages. I tried out the expression below in graph explorer but i got an error. I managed to get insights for just one post using its id, but it doesn't seem to work when I want to get all the posts at once.
{page-id}/posts/?fields=insights{post_impressions_unique}
{
"error": {
"message": "Invalid query",
"type": "OAuthException",
"code": 3001,
"error_subcode": 1504028,
"is_transient": false,
"error_user_title": "No Metric Specified",
"error_user_msg": "No metric was specified to be fetched. Please specify one or more metrics to be fetched and try again.",
"fbtrace_id": "Ao79E5/rtfn"
}
}
Any ideas?
The /object-id/insights/metricname syntax does not translate into foo{bar} like other sub-fields, you need to use a slightly different syntax here:
?fields=insights.metric(post_impressions_unique)

Facebook Graph API calls

When i use GET /v2.4/{photo-id} in graph API explorer
It throws an error :
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: {user-id}",
"type": "OAuthException",
"code": 803
}
}
what does this really mean ? any help
You seem to be passing {user-id} which is not a valid data to query about.
Instead, use the below code without {user-id}:
GET /v2.4/{photo_id}
{photo_id} is an id of a post most probably in the userid_postid ("10000_00001") format.