From ccdfa150f095d6f95ca01d0c8877852a6de9d2ee Mon Sep 17 00:00:00 2001 From: Tony Novak Date: Mon, 25 Sep 2023 15:14:25 -0400 Subject: [PATCH] Pass scope parameter as a string, not a list of Permissions The scope parameter needs to be a string containing a comma-separated list of scopes, e.g. "ads_management,manage_pages". Fixes #97. --- lib/facebook_ads/ad_objects/business.rb | 4 ++-- lib/facebook_ads/ad_objects/user.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/facebook_ads/ad_objects/business.rb b/lib/facebook_ads/ad_objects/business.rb index cb78332a..782a0b01 100644 --- a/lib/facebook_ads/ad_objects/business.rb +++ b/lib/facebook_ads/ad_objects/business.rb @@ -342,7 +342,7 @@ class Business < AdObject edge.post 'Business' do |api| api.has_param :app_id, 'string' api.has_param :fbe_external_business_id, 'string' - api.has_param :scope, { list: 'Permission' } + api.has_param :scope, 'string' api.has_param :system_user_name, 'string' end end @@ -936,7 +936,7 @@ class Business < AdObject edge.post 'Business' do |api| api.has_param :asset, { list: 'int' } api.has_param :fetch_only, 'bool' - api.has_param :scope, { list: 'Permission' } + api.has_param :scope, 'string' api.has_param :set_token_expires_in_60_days, 'bool' api.has_param :system_user_id, 'int' end diff --git a/lib/facebook_ads/ad_objects/user.rb b/lib/facebook_ads/ad_objects/user.rb index 81961472..27742b6f 100644 --- a/lib/facebook_ads/ad_objects/user.rb +++ b/lib/facebook_ads/ad_objects/user.rb @@ -91,7 +91,7 @@ class User < AdObject edge.post 'User' do |api| api.has_param :business_app, 'int' api.has_param :page_id, 'string' - api.has_param :scope, { list: 'Permission' } + api.has_param :scope, 'string' api.has_param :set_token_expires_in_60_days, 'bool' end end