Search code examples
facebook-graph-apifacebook-marketing-api

Get data from advertising Facebook account from Marketing API


I want automatically collect data from fb ad account with marketing api.

There is an facebook app, which has access to advertising account (with access level = development). App has product 'Marketing API'.

Got access_token (app_id|token) like this:

GET https://graph.facebook.com/oauth/access_token?client_id=<app_id>&client_secret=<secret>7&grant_type=client_credentials

When i try insights method

GET https://graph.facebook.com/v2.8/act_<ad_account_id>/insights/?access_token=<access_token>

i got an error

"message": "Unsupported get request.", "type": "GraphMethodException", "code": 100

Solution

  • Try to generate not app token, but user token of someone who has access to that ad account.