diff --git a/facebook_business/adobjects/serverside/event_request.py b/facebook_business/adobjects/serverside/event_request.py index b100f973..144c99aa 100644 --- a/facebook_business/adobjects/serverside/event_request.py +++ b/facebook_business/adobjects/serverside/event_request.py @@ -282,9 +282,14 @@ def execute(self): fields=[], params=params, ) - return EventResponse(events_received=response['events_received'], + if response.get('events_received'): + return EventResponse(events_received=response['events_received'], fbtrace_id=response['fbtrace_id'], messages=response['messages']) + else: + return EventResponse(events_received=0, + fbtrace_id=response['fbtrace_id'], + messages=response['messages']) def execute_with_client(self, params): url = '/'.join([ diff --git a/facebook_business/adobjects/serverside/event_request_async.py b/facebook_business/adobjects/serverside/event_request_async.py index 3aac6e16..3189661f 100644 --- a/facebook_business/adobjects/serverside/event_request_async.py +++ b/facebook_business/adobjects/serverside/event_request_async.py @@ -94,7 +94,7 @@ async def execute(self): return EventResponse(events_received=response['events_received'], fbtrace_id=response['fbtrace_id'], messages=response['messages']) - else + else: return EventResponse(events_received=0, fbtrace_id=response['fbtrace_id'], messages=response['messages'])