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

Issue in fetching lead details when using a sample code #85

Closed meer-online closed 4 years ago

meer-online commented 4 years ago

Which SDK version are you using?

Lastest version

What's the issue?

The sample code given here to fetch leads data doesn't seem to be working https://github.com/facebook/facebook-ruby-business-sdk/blob/master/examples/UserLeadGenInfoNode.rb

Steps/Sample code to reproduce the issue

Just to be clear I did set the access token and other variables needed for this code to return results

Observed Results:

its returns the following response with the lead id but none of the details are included.

<FacebookAds::Lead {:id=>"24595039271296603"}>

Expected Results:

Lead details should be returned.

Any quick help will be much appreciated.

meer-online commented 4 years ago

Also if i use require 'facebook_ads' instead of require 'facebookbusiness'i get an error

undefined method "configure" for FacebookAds:Module (NoMethodError)

Any thoughts?

jingping2015 commented 4 years ago

Hi, Thanks for reporting this issue. Actually you need to specific the fields you want

lead = FacebookAds::Lead.get(id ,'field1, field2,')