-1

When I perform the following form query on Facebook Graph API Explorer, the date range seems to be being ignored. No matter what range I used it brings back the same results.

Can date range searches only be used on specific kinds of queries, or is my query wrong?

https://graph.facebook.com/[formID]type=form&from_date=1552694400&to_date=1552780799&fields=id,leads%7Bform_id,ad_name,platform,created_time,field_data,custom_disclaimer_responses,retailer_item_id%7D

Unfortunately, I can't post a sample result due to GDPR.

Matt
  • 9
  • 4
  • 1
    timebased paging is usually done with `since` and `until`, are you sure `from_date` and `to_date` are valid parameters? – andyrandy Mar 15 '19 at 11:32
  • @luschn According to this page - if you scroll down to Filtering - it is. https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving – Matt Mar 15 '19 at 12:04
  • @luschn Just tried `since` and `until`. That doesn't work either. – Matt Mar 15 '19 at 12:47

1 Answers1

1

The doc you refer the parameters is related to the export_csv download url.

You should use:

Filtering Leads

This example filters leads based on timestamps. Timestamps should be Unix timestamp.

curl -X GET \
  -d 'filtering=[
       {
         "field": "time_created",
         "operator": "GREATER_THAN",
         "value": 1552051944
       }
     ]' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v3.2/{adgroup-id}/leads

Optionally this other methods should work:

curl -X GET \
-d 'since=1454600660' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v3.2/{adgroup-id}/leads

Hope this help

NB: you can use form-id instead of the adgroup-id

Matteo
  • 37,680
  • 11
  • 100
  • 115
  • I'm using c# .net, but someone decided to remove those tags. Also, that method requires you to download a file - I believe. Not what I want to do. – Matt Mar 15 '19 at 14:27