I'm creating a datacollector which would fetch data from public available ad in order to retrieve it on my app.
Basically, I would like to create a copycat of the official tool from Meta on my application.
I followed the Meta Ad Library API Guide, generated the user token access and when I make a call (e.g. https://graph.facebook.com/v20.0/ads_archive?ad_reached_countries=["FR"]&search_terms=savon&access_token=MY_TOKEN) I always have this return :
{ "error": { "message": "Application does not have permission for this action", "type": "OAuthException", "code": 10, "error_subcode": 2332004, "is_transient": false, "error_user_title": "App role required", "error_user_msg": "You need to be assigned a role by the app owner to continue. Learn more at https://developers.facebook.com/docs/development/build-and-test/app-roles", "fbtrace_id": "AEtWDzYFQypjN8PvUhnHwSQ" }
I've seen many issues identical to mine (another one here) and I don't really understand as my user is an administrator, of a fully verified business.
I even found people saying it's because the app doesn't have the correct scopes (such as : ads_read, public_profile). I can't add the scope "ads_archive" on my app as I can't see it anywhere in App Review > Permissions and Features on my developer account, otherwise everything seems okay, here is the debug of my token :
{ "data": { "app_id": "APP_ID", "type": "USER", "application": "APPLICATION_NAME", "data_access_expires_at": 1734880167, "expires_at": 1727107200, "is_valid": true, "scopes": [ "read_insights", "pages_show_list", "ads_management", "ads_read", "business_management", "pages_read_engagement", "pages_read_user_content", "public_profile" ], "granular_scopes": [ { "scope": "pages_show_list" }, { "scope": "ads_management" }, { "scope": "ads_read" }, { "scope": "business_management" }, { "scope": "pages_read_engagement" }, { "scope": "pages_read_user_content" } ], "user_id": "USER_ID" }
}
How to finally access the public data ?