Posts under category facebook-graph-api

I have created a page named Test 1. When I go to Business Suite, my Business Portfolio and add the page Test 1 to Account -> Pages. After adding the page successfully I see page access section where I have full control over the page Test 1.

But after giving permission to the page Test 1 from the Developer app I am unable to generate page information like Page name, page id, access token etc... But when I remove the page from Meta Business Suit/Business Portfolio and again give the permission to the page from the developer app then I am able to generate the page details like access token, name and id.

My question is why I am unable to generate page details from graph api if the page is added to facebook business portfolio?

I have tried multiple time, but when the page is added to Meta Business Portfolio then I am unable to generate page details like id,name and access token

In my application I want users to edit their leadgen forms. As far as I know there is no possibility to edit a leadgen form. Simply creating a new leadgen form with the desired changes would result in losing linked data, such as leads.

Therefore, via the UI (Adsmanager) one would copy the leadgen form and make the desired changes which keeps the linked data (leads).

I was wondering if there is a [leadgen_form_id]/copy endpoint? Or how can I edit a leadgen form without losing linked data.

So,I managed to get an API key with the correct permissions to make posts as a Page. Based off of some online reading, other users should not see the posts I make just yet as my Facebook App has not yet gone live. However, according to those texts, I should still be able to see them as I am the admin, but I check the page, and I cannot see any post that I've made through the Graph API. I'm not sure if I'm done something wrong or not. No errors appears, no crashes occur.

Edit: Using a different source text, the new posts appear for some reason. I'm wondering if this has to do with links in the content. Do links within these kinds of posts have to appear under their own parametre(s)?

We have a Facebook App created with a dummy User to manage Ads and Audience to which it has access to. Unfortunately it's complicated at the moment to create it under a proper company's User, because we manage many Pages and Clients and there is a lot of burocracy.

In any case, the Access Token associated to this Facebook App works fine and has its live span set to 90 days: the trouble is that after 30 days of the dummy User's inactivity on Facebook, the user get dissociated from the Facebook App. This results in our automated refreshToken call to fail. We have to manually login and re-connect the User to the Application. In fact, the APIs calls we do for our business purpose aren't enough / aren't considered as User's actions: this sound both fair and unintuitive.

Is there a knowkn way or an API call (even as simple as "list your own feed") to keep the User's session active?

Thank you in advance for any tips.

My current project involves creating a social media management app using Nest.js and Next.js. Passport Facebook has been set up on my server side and tested on the server side, and it works well. When I move to the client side and attempt to verify if the access token is saved on the database or not, i sent a request to the endpoint 'api/social-accounts/facebook', but Facebook seems to block it. This is the error message I received. : 'Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.facebook.com/v3.2/dialog/oauth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fapi%2Fsocial-accounts%2Ffacebook%2Fcallback&client_id=1169598374207494. (Reason: CORS request did not succeed). Status code: (null).' here is my controller :

@Controller('api/social-accounts') export class SocialAccountsController {   constructor(private readonly socialAccountService: SocialAccountsService) {}   @UseGuards(AuthGuard('facebook'))   @Get('facebook')   async getAccessToken() {     console.log('arrived here. [get access token]');   }   @Get('facebook/callback')   @UseGuards(AuthGuard('facebook'))   async facebookAuthCallback(@Req() req: any) {     const { socialAccount, user } = req;     const { accessToken, profile } = socialAccount;     await this.socialAccountService.saveSocialAccountAccessToken(       {         access_token: accessToken,         expires_in: null,         social_user_id: profile?.id,       },       user,     );     return 'Your account has been connected.';   } } 

here is my facebook strategy :

import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { PassportStrategy } from '@nestjs/passport'; import { Strategy } from 'passport-facebook'; import { SocialAccountsService } from '../social-accounts.service'; @Injectable() export class FacebookStrategy extends PassportStrategy(Strategy, 'facebook') {   constructor(private readonly config: ConfigService) {     super({       clientID: config.get<string>('APP_ID'),       clientSecret: config.get<string>('APP_SECRET'),       callbackURL:         'http://localhost:8000/api/social-accounts/facebook/callback',       profileFields: ['id'],     });   }   async validate(     accessToken: string,     _refreshToken: string,     profile: any,     done: any,   ): Promise<any> {     const socialAccount = { accessToken, social_user_id: profile.id };     console.log({ socialAccount });     done(null, socialAccount);   } } 

I am try to connect the facebook account without using passport but still has seem issue. Adding a mechanism to authenticate to the app with a Facebook account is not something I want to do. I want the user to be able to add their Facebook account to the app to manage it.