I am trying to retrieve the from field for comments on a post using the Facebook Graph API. The from field is showing correctly for page authors but not for regular users who comment on the post.

I have ensured that I have the required permissions, including:

email pages_show_list pages_read_engagement pages_read_user_content pages_manage_posts

The API request I am making is as follows:

**GET /{page_post_id}/comments** 

As per the Facebook Graph API documentation, this should return the from field for all comments. However, the from field is missing for users and is only available for page authors. i am also using user access and page access token as docs suggest but still the issue persist.

  1. Verified that I have all the required permissions.
  2. Checked the API request to ensure it was correctly formatted according to the documentation.
  3. Tried testing the request with different page posts and still encountered the same issue.
  4. Use Facebook graph API Explorer to test different permissions and endpoints. but there is also from field missing.

I have been researching several Stack Overflow articles but i did not point any potential solution, and it seems that many people are experiencing the same issue in the Facebook community. It would be very helpful if someone could provide me with the latest information. I need to know whether this is an issue with V20 or if I am missing something.

I expected the from field to return the information for both users and page authors, but it's only appearing for page authors.

In the documentation here: https://developers.facebook.com/docs/instagram-platform/ it says that the Instagram APIs are for Business and Creator Instagram account users while the Instagram Basic Display API is for non-business and non-creator Instagram accounts. Our use case allows Instagram users to show a few images of their recent Instagram image posts in our app so the Instagram Basic Display API fits this perfectly. With Instagram deprecating that API soon, the documentation does not clearly show an alternative that can be used for non-business and non-creator Instagram accounts. It's recommending to use the Instagram API but the documentation clearly says it does not fit our use case due to the type of our Instagram users. So which API do we use when they deprecate the Instagram Basic Display API?

I'm encountering an issue with the Facebook Graph API where the responses do not respect the specified date ranges in my queries. Here are the details of my requests and the responses I receive:

Query using time_range:

/campaigns?level=campaign&fields=account_id,effective_status,id,name,insights{reach,dda_results,frequency,cost_per_conversion,spend,impressions,cpm,clicks,cost_per_unique_click,purchase_roas,actions,action_values},lifetime_budget,start_time&limit=1&time_increment=1&time_range={'since':'2024-09-07','until':'2024-09-08'} 

Response:

"insights": {     "reach": "372827",     "date_start": "2024-08-12",     "date_stop": "2024-09-10" } 

Query using date_preset=yesterday:

/campaigns?date_preset=yesterday&level=campaign&fields=account_id,effective_status,id,name,insights{reach,dda_results,frequency,cost_per_conversion,spend,impressions,cpm,clicks,cost_per_unique_click,purchase_roas,actions,action_values},lifetime_budget,start_time&limit=1&time_increment=1 

Response:

"insights": {     "reach": "372827",     "date_start": "2024-08-12",     "date_stop": "2024-09-10" } 

Despite specifying narrow date ranges, the API returns data spanning almost a month. Has anyone else faced this issue, or can provide insights on how to enforce the specified date range in the query?

  • I'm using Laravel Socialite to handle Facebook authentication in my Laravel application, and I’m working in a test environment only. I have successfully integrated Socialite to allow users to log in with their Facebook accounts. Now, I need to fetch a list of the user's Facebook friends after they authenticate.

  • I've reviewed the Laravel Socialite documentation and the Facebook Graph API documentation, but I’m unsure how to proceed with obtaining the list of friends.

  • Facebook Permissions: I’ve made sure to request the user_friends permission during the login process.

  • API Calls: I’ve attempted to use the Graph API directly to fetch friends but haven't been able to integrate it smoothly with Socialite.

Here’s a snippet of the code I’m using to authenticate users:

public function redirectToProviderFacebook(){        return Socialite::driver('facebook')->scopes(['user_friends'])->redirect();     } public function handleProviderCallbackFacebook(Request $request){         try {             $user = Socialite::driver('facebook')->stateless()->user();             $accessToken = $user->token;             // Get friends             $response = Http::withToken($accessToken)                 ->get('https://graph.facebook.com/me/friends');             $friends = $response->json();             dd($friends);             $data = User::where`your text`('email', $user->email)->first();             if (is_null($data)) {                 $users['name'] = $user->name;                 $users['email'] = $user->email;                 $users['password'] = Hash::make('password');                 $data = User::create($users);             }             Auth::login($data);             return redirect('dashboard');         } catch (\Exception $e) {             // Log the error or return a meaningful message             Log::error('Facebook OAuth error: ' . $e->getMessage());             return redirect()->route('login')->with('error', 'Authentication failed.');         }     } 
  • How do I use Laravel Socialite to fetch a user’s list of friends from Facebook in a test environment?

  • Are there any specific settings or configurations needed in the Facebook Developer Console for accessing friends data in a test environment?

  • Can you provide an example of how to make a request to the Facebook Graph API to get friends data after authentication?

Any guidance or examples would be greatly appreciated!