Generating a Facebook Marketing Token that Never Expires

Summary

Exploring options to generate a Facebook marketing token that does not expire, currently expires every 60 days requiring manual refresh.


Question

Hi guys, I am using a Facebook marketing connector. Is there a way to generate a Facebook marketing token that never expires?
Right now, the token expires every 60 days, and I need to refresh it manually. any suggestions?



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want to access the original thread.

Join the conversation on Slack

["facebook-marketing", "token-expiration", "connector"]

You can refresh them automatically: https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived/

Alternatively use a system user. They used to be permanent, but don’t know about now.

<@U06GGMLCKMW> Thanks for the response. Did you succeed in using the system user?

I haven’t tried recently, am not currently using the Facebook API for anything.

All Facebook Graph API tokens (long lived ones) expires in 90 days. As said in the documentation for client users using the Javascript SDK (or other SDK like IOS) the token is automatically refreshed after the user call API with the token still valid (an expired token can’t refresh itself).

About system users you can refer to this documentation: https://developers.facebook.com/docs/marketing-api/system-users/create-retrieve-update

It’s a bit more complex way to manage this “non expiring” tokens but I think can work too.

Another way you can manage it is to run a cron job periodically and refresh all the accounts where the token expiring date is less than X (you can define it yourself). And then a method would refresh the token and update the source in the Airbyte API.

https://reference.airbyte.com/reference/start