facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
209 stars 160 forks source link

Ad Account end_advertiser parameter should accept string #9

Closed premist closed 4 years ago

premist commented 7 years ago

When creating a new AdAccount on business, end_advertiser should be provided in string format. However, it is defined as object as you can see below:

https://github.com/facebook/facebook-ruby-ads-sdk/blob/a36667227509db43a37ea8fe32d1710464f7eb4d/lib/facebook_ads/ad_objects/business.rb#L66

This raises # because lib/facebook_ads/field_types/object.rb tries to generate JSON from a string.

https://github.com/facebook/facebook-ruby-ads-sdk/blob/a36667227509db43a37ea8fe32d1710464f7eb4d/lib/facebook_ads/field_types/object.rb#L29

Example code used

@business = FacebookAds::Business.get("BUSINESS_ID", "name", MY_BUSINESS_MANAGER_ADMIN_ACCOUNT_SESSION)
@business.adaccount.create(name: "Test AdAccount", currency: "USD", end_advertiser: MY_APP_ID)

# JSON::GeneratorError: only generation of JSON objects or arrays allowed
# from /Users/premist/.gem/ruby/2.3.4/gems/json-1.8.6/lib/json/common.rb:223:in `generate'

References

stale[bot] commented 4 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.