I have to call some urls like the following; the error I get in my Nodejs app and whit a curl command test in bash is:
{"error":{"message":"(#100) For field 'delivery_estimate': The parameter targeting_spec is required","type":"OAuthException","code":100
The problem is that if I put the url in the browser, it returns the data.
curl command for test (I removed token data for privacy; this command throws an error):
curl -ov --trace - --trace-time ~/Desktop/lavoro-desktop/01-logs/curl_output.txt https://graph.facebook.com/v13.0/act_xxx/delivery_estimate?access_token=___access_token___&&optimization_goal=REACH&targeting_spec={%27geo_locations%27:{%27countries%27:[%27BY%27],%27location_types%27:[%22travel_in%22]},%27age_min%27:15,%27age_max%27:64,%27genders%27:[0]}
For those interested, this works:
curl -o ~/Desktop/lavoro-desktop/01-logs/curl_output.txt 'https://graph.facebook.com/v13.0/act_xxx/delivery_estimate?access_token=my_access_token&&optimization_goal=REACH&targeting_spec={%27geo_locations%27:{%27countries%27:[%27BY%27],%27location_types%27:[%22travel_in%22]},%27age_min%27:15,%27age_max%27:64,%27genders%27:[0]}'