0

I started using php sdk of Facebook and I generated an access token using the Graph API Explorer and I set all the permissions there.

Now I use that token in my code like:

\FacebookAds\Api::init(config('facebook.app_id'), config('facebook.app_secret'), config('facebook.access_token, false);
\FacebookAds\Api::instance();

After 60 days (the expire time of a "long lived" token) I face the issue that my token is not valid anymore.

Is there a way to generate a token by code and grant him the required permissions. In my case:

  • The lead_retrieval permission
  • The pages_manage_metadata permission
  • The pages_show_list permission
12
  • "Is there a way to generate a token by code and grant him the required permissions." - the point of OAuth is, that is requires user interaction - so, no. But within the marketing API realm, there are system and business users, and those have different rules regarding token expiry, I think.
    – CBroe
    Mar 17 at 6:52
  • The point of an auth system is that a user grants itself permission? That should never be the case in any auth system. Permissions should be granted from higher order
    – JanBoehmer
    Mar 17 at 7:10
  • The user does not grant themselves permission, they grant it to your app.
    – CBroe
    Mar 17 at 7:12
  • So "Create a token with lead_retrieval permission" is not possible?
    – JanBoehmer
    Mar 17 at 7:15
  • 1
    Of course it is, by implementing the login flow.
    – CBroe
    Mar 17 at 7:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy