The problem: My batch request returns passed group events and the current batch request will scale badly with users creating future events.
I have the following batch request:
{
"batch": [
{
"method": "GET",
"relative_url": "me"
},
{
"method": "GET",
"relative_url": "me/groups?fields=events{id,name,start_time}"
},
{
"method": "GET",
"relative_url": "me/accounts"
}
],
"include_headers": "false"
}
This request will fetch (among other things) all user group events. I only need upcoming events.
Question: How can I apply filters in a Batch request?
The following query URL is not working when used as a relative_url:
me/groups?fields=events{id,name,start_time}&since=1599036240
The filter parameter is:
since=MY_CURRENT_TIME
The documentation I read wasn't of much help. I don't even know if it is possible to add filters (fields) to a batch request. ( https://developers.facebook.com/docs/graph-api/making-multiple-requests/ )
I also asked the same question on the FBs dev forum with no answer (so far): https://developers.facebook.com/community/threads/325616225418947/?notif_id=1599002283105969¬if_t=developer_community_forum_thread_update&ref=notif
UPDATE 1 (02.09.2020.):
@CBroe pointed out that the Batch Requests URLs should work the same as standalone requests. This leads me to believe that my relative_url
does not filter properly. Testing:
me/groups?fields=events{id,name,start_time}&since=1599036240
with output:
events": {
"data": [
{
"id": "324058568947509",
"name": "Testing FB Graph API",
"start_time": "2020-08-25T15:00:00+0200"
}
],
conforms that filtering does not work with &since=1599036240
and the URL containing {}
.