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