maraujo / pySocialWatcher

Social Watcher on Facebook Marketing API
MIT License
109 stars 49 forks source link

"Param currency on field delivery_estimate" Error #24

Closed jdafermos closed 4 years ago

jdafermos commented 4 years ago

Hi, i've been trying to collect some data from facebook in order to learn how to use pySocialWatcher. I've setup an account with ID and Token, followed your instructions and typed command:

watcher.run_data_collection("pysocialwatcher/input_examples/jdafermos_example.json")

where my "jdafermos_example.json" file is:

{ "name": "Data in Crete", "geo_locations": [ { "name": "regions", "values": [{"key":"4170"}], "location_types": ["region"] } ], "genders": [0], "ages_ranges": [ {"min":18, "max":75} ] }

The skeleton file is saved, but when it tries to collect the data an error message about "Param currency on field delivery_estimate" appears which includes the following lines:

FatalException: '{"error":{"message":"(#100) Param currency on field delivery_estimate: This param is not valid","type":"OAuthException","code":100,"fbtrace_id":"Ahe7jEVHUwoWhbm2wUTnMVQ"}}'

pysocialwatcher.utils.FatalException: 'FatalError: Check logging for clue. No way to proceed from here.'

Do you know if there is any solution to this? Thank you

chiccorampazzo commented 4 years ago

Hi Yiannis,

In your local installation of pySocialWatcher look for the 'utils.py' file. In that file there is a function called 'call_request_fb'. In the function there is a dictionary variable called 'payload'; delete the line that says ''currency': 'USD','.

Also, I think your age parameter should have max age at 65.

"ages_ranges": [ {"min":18, "max”:65} ]

Best, Francesco

jdafermos commented 4 years ago

Hi Francesco, I did what you said and also fashioned my json file after the "quick_example.json" input file and it's working! My json input file now looks like:

{ "name": "Data in Crete", "geo_locations": [ { "name": "regions", "values": [{"key":"4170"}], "location_types": ["recent"] } ], "genders": [0], "ages_ranges": [ {"min":18, "max":65} ], "scholarities":[{ "name" : "Graduated", "or" : [3,7,8,9,11] }], "languages":[{ "name" : "Arabic", "values" : [28] }], "behavior": [ { "or": [6015559470583], "name": "Expats" }], "interests": [{ "or": [6007828099136,6003392552125], "name": "Not very good" }] }

So now I need to figure out how to change the parameters into what I need. Thank you!