Posts tagged with facebook-graph-api

I am trying to retrieve a list of all pages (business and non-business) that the account has. However, only non-business pages are currently being returned.

First I allow the user to login. He/she gets a Facebook Login popup, where he/she can select the pages. Then I generate a long-lived token, like so:

const response = await axios.get(   "https://graph.facebook.com/v21.0/oauth/access_token",   {     params: {       grant_type: "fb_exchange_token",       client_id: process.env.FB_APP_ID,       client_secret: process.env.FB_APP_SECRET,       fb_exchange_token: fbAccessToken,     },   } ); 

I get a token just fine. I return the token and the client makes an api call to retrieve the pages:

const handleFacebookCallback = async (response: any) => {   if (!response?.id) {     return;   }   setLoading(true);   const { data } = await api.post("/api/integrations/facebook/user", {     userId: user._id,     fbAccessToken: response.accessToken,     fbUserId: response.id,   });   const url = `https://graph.facebook.com/v21.0/${response.id}/accounts?access_token=${data.longLivedToken}`;   const fbResponse = await fetch(url);   const fbData = await fbResponse.json();   setResponseFbPages(fbData.data);   setLoading(false); }; 

Now, I have 3 pages - 2 are business and 1 non-business. Only the non-business pages are getting returned.

I tried to query the /accounts endpoint, and I am expecting to get a full list of pages returned.

In threads documentation: https://developers.facebook.com/docs/threads/posts

They gives the details of Threads Graph API to post content on Threads platform. Here:

They don't mention that how we can get our threads-user-id. Please tell me how I can get that.

I already search on Facebook developer account and they don't mention any type of thread-user-id their.

I used my threads account username but it didn't work for me as well.

I am using the Facebook Video API to publish reels to a facebook page. I can sucessfully publish the reel to my page, but it is not visible to anyone else, meaning it is probably private.

I couldn't find any settign or parameter in the API to make the video public

I assume the issue is with permissions? I am using page access tokens for each page, and these are the permissions set for the app:

read_insights publish_video pages_show_list business_management instagram_basic instagram_manage_comments instagram_manage_insights instagram_content_publish instagram_manage_messages pages_read_engagement pages_manage_metadata pages_read_user_content pages_manage_posts pages_manage_engagement

I hope someone knows what the issue is

I saw that there is another permission: public_profile that should be set, but I just don't see it, it's not in the list of permissions

Do I need to verify the app? (it's in development). I just don't have an actual app, I am using make.com to make api requests to facebook graph api and video api

I am currently trying to retrieve likes and comments for my post on facebook graph explorer. I get response bug, there is only my like, those other are missing whereas there is really much more likes.

Retrieving comment, all comments are on the response but, comment's authors are missing whereas I set in the field query.

These are the autorisation I set:

  • pages_show_list
  • pages_read_engagement
  • pages_read_user_content
  • pages_manage_posts
  • pages_manage_engagement

This is the response for likes requests from facebook explorer: /404084156710515_625686649729154?fields=comments{from,created_time},likes{id,name,username}

{   "comments": {     "data": [       {         "created_time": "2023-09-24T04:43:38+0000",         "message": "comment1",         "id": "625686649729154_1692834397884940"       },       {         "created_time": "2023-09-23T14:06:09+0000",         "message": "comment2",         "id": "625686649729154_326839209849302"       },       {         "created_time": "2023-09-22T15:47:49+0000",         "message": "comment3",         "id": "625686649729154_288127333934812"       }     ],     "paging": {       "cursors": {         "before": "NgZDZD",         "after": "MQZDZD"       }     }   },   "likes": {     "data": [       {         "id": "27817357317847681",         "name": "ME"       }     ],     "paging": {       "cursors": {         "before": "QVFIUnRwSFRRc0ZAfLTFVS24wUjRrb1FrZAzMyNzRsU3ZA1RE5MakFvYm42aUptS1EtUzhuWlJXMUlGVHBpd3h5c3pQWHdzMGNNcWlqSkg3UFJxbEdrTG5Kd3BB",         "after": "QVFIUl9wanJEUDdON2tNV1JsRngyakdwZA1c2TENzTE95cUV6RHdGc01EdVhndWdmZAkduc3hWRFBGbTlrRTh3Yjl5YV9IaFV2VDlYcTAwTWxEeTNGdWxuc1ln"       },       "next": "https://graph.facebook.com/v21.0/404084156710515_625686649729154/likes?access_token=<MY_TOKEN>&pretty=0&fields=id%2Cname%2Cusername&limit=25&after=QVFIUl9wanJEUDdON2tNV1JsRngyakdwZA1c2TENzTE95cUV6RHdGc01EdVhndWdmZAkduc3hWRFBGbTlrRTh3Yjl5YV9IaFV2VDlYcTAwTWxEeTNGdWxuc1ln"     }   },   "id": "404084156710515_625686649729154" } 

I appreciate your help, thank you.

I'm working on a Facebook integration and need to retrieve comments from posts on any public Facebook Page (not just Pages I manage) using webhooks.

My app type is currently set to Consumer. I read that switching to Business might help, but I’m not sure if that alone will grant broader permissions.

1. What are the steps to follow to request access to public page comments for any Facebook Page?

  1. What app type should I create in the Facebook Developer Apps section, and which specific permissions should I request?

3.Can I convert my app type from Consumer to Business, and if I do, will that allow access to comments on any public Page?

4. How can I add a page to my app to receive comments via Webhooks for Pages I don’t manage?

What I’ve Tried:

  1. My app type is currently set to Consumer. I read that switching to Business might help, but I’m not sure if that alone will grant broader permissions.

  2. I’ve requested pages_read_engagement and pages_manage_engagement, but they only seem to work for Pages that the app or user manages.

  3. Looked into Public Content Access, but the guidelines are unclear on how to access comments specifically.