Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "OAuthException, code: 200, message: (#200) Permissions error" while requesting ad_insights GraphAPI. #693

Open
inmar-mohan opened this issue Jul 3, 2024 · 0 comments

Comments

@inmar-mohan
Copy link

Hi there,

Thanks for this gem, it made our life easier working with the Meta Ads.
Recently, We have been getting this Koala::Facebook::ClientError: type: OAuthException, code: 200, message: (#200) Permissions error, x-fb-trace-id: BoIlOqL6qEC [HTTP 403] from /usr/local/bundle/gems/koala-3.0.0/lib/koala/api.rb:50:in graph_call error when requesting ad_insights(v17.0) API. I sent the same GraphAPI request for these Ads on GraphAPI Explorer, and we got a successful insights response without any OAuthException, code: 200, message: (#200) Permissions errors.

We have all these permissions to our access token:

Screenshot 2024-07-03 at 11 29 41 PM

Sent ad insights request with the Koala Gem, got OAuthException for the ad_id 6541533064176:

Intercepting get_connections(6541533064176, , {:fields=>"name,adset_id,creative{id,object_story_spec{   link_data{name,description,message,link,caption}}},insights.date_preset(maximum){              actions,unique_actions,cost_per_action_type,cost_per_unique_action_type,website_ctr,account_id,campaign_id,              adset_id,ad_id,video_avg_time_watched_actions,              video_30_sec_watched_actions,video_p100_watched_actions,video_p25_watched_actions,              video_p50_watched_actions,video_p75_watched_actions,video_p95_watched_actions,              date_start,date_stop,impressions,unique_clicks,spend,frequency,cost_per_inline_post_engagement,              inline_link_clicks,cost_per_inline_link_click,inline_post_engagement,reach,ctr,unique_ctr,              unique_link_clicks_ctr,cpm,cpp,cost_per_unique_click,estimated_ad_recall_rate,              cost_per_estimated_ad_recallers,video_play_actions}"})
Koala::Facebook::ClientError: type: OAuthException, code: 200, message: (#200) Permissions error, x-fb-trace-id: BoIlOqL6qEC [HTTP 403]
from /usr/local/bundle/gems/koala-3.0.0/lib/koala/api.rb:50:in `graph_call'

Sent the same Ad insights request on GraphAPI Explorer for the ad_id 6541533064176:

Screenshot 2024-07-03 at 11 35 48 PM

I updated koala gem from v17.0 to the latest v20.0, but no luck, still getting the same OAuthException, code: 200, message: (#200) Permissions errors. Can someone please look into this issue? We are unable to figure out why we are getting OAuthExceptions only when requesting with the Koala gem. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant