Skip to content

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

Open
@inmar-mohan

Description

@inmar-mohan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions