1

I am trying create an automated process to pull Facebook Ads data with the c# Facebook api (facebook.ddl) on a daily bases. The process needs to be fully automated so that no human intervention is needed. I was able to pull the data when using an "user" access tokens; however, the “user” access tokens expired after a short period of time (e.g., 2 hours) and required a user to confirm the request for a new token. It other words, any implementation of an user access token would prevent me from fully automating the process. Next, I tried to pull the Facebook Ads data with an "app" access token but the process failed with an error message related to security/permissions. Currently, it is my understanding that "app' access token were not design to access Facebook Ads data. Is this correct? If so, I would like to know if it is possible to pull Facebook Ads data via a fully automated process and (if it is) how to do it?

1 Answer 1

1

You should exchange the short exchange the short-lived 2 hour token for a 60 day long-lived token. Process is outlined here.

2
  • I read the processed but we need a token that will not expire. We not have access to our production environment and it is not feasible to redeploy the code every two month or create an overly complex process that would still need manual intervention every two months. Commented Jan 29, 2013 at 20:11
  • @BiteamBigFish Unfortunately Facebook doesn't operate that way. The maximum lifetime of a token is 60 days, and that's assuming that you exchange the initial two hour token for the 60 day one. Facebook does give you an expiration timestamp for that new 60 day token, so it's possible that you can monitor that and notify your users to log back into your application so you can run another token exchange. It's unfortunate, I know. But you have to work with what Facebook gives you. Commented Jan 31, 2013 at 4:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.