问题
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?
回答1:
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.
回答2:
- Create a facebook app.
- Go to the Graph API Explorer in Facebook's Tools & Support section.
- Pick your app from the drop down.
- Hit Get Token > Get User Access Token.
- In Select Permissions choose required permissions or select them from extended permissions.
- Use the user access token that will be presented to you in the access token form input field.
来源:https://stackoverflow.com/questions/28834319/how-to-generate-facebook-marketing-api-access-token-to-use-it-in-windows-applica