Facebookads API : Check the job status and get the result later in python

Discussion in 'Facebook API' started by rajkoti, Jun 14, 2017.

  1. #1
    submitted the job to in async mode to pull the ad insights data from facebook by using facebookads api.

    r = ad_account.get_insights(params=params, async=True)

    Stored the report_run_id

    I want to check the status of this job in different python code and pull the result in that script instead of same script.

    If it is in the same job, I know how to check the status and get the result.

    while r[AdReportRun.Field.async_percent_completion] < 100:
    time.sleep(5)
    r.remote_read()
    result = r.get_result()

    in other words, If I have data (it has report_run_id column). How to check the job status and get the result.

    Planning to move this script to google appengine, google appengine has 60sec time out window. So I need to check the job status later point of time and if the job is success pull the data and load into BigQuery.
     
    rajkoti, Jun 14, 2017 IP