How to generate Facebook Marketing API access token to use it in Windows application

watbywbarif picture watbywbarif · Mar 3, 2015 · Viewed 11.6k times · Source

I am using Facebook as advertising platform to promote my application on Apple and Google stores. I would like to make windows service which will download daily report(s) about advertising status of my marketing campaign running one Facebook, preferably using 60 day token, or some permanent solution so that token is retrieved when required. I think that i understand everything to do this except how to generate access token to use it with Facebook Graph API. Which token for which Facebook account do I need and how to obtain it?

Answer

bjeavons picture bjeavons · Mar 3, 2015

You'll need a Facebook app and to grant that app the ads_read permission in order to retrieve reports about your advertising efforts via the API (source).

You'll want a long-lived token so that you don't have to re-authenticate very often. The access token documentation details the steps to exchange a short-lived token for a long-lived one.

You may also want to consider managing the app, ad account, and access tokens (via a business system user) with the FB Business Manager.