facebook-python-business-sdk icon indicating copy to clipboard operation
facebook-python-business-sdk copied to clipboard

GET Time_Increment Broken

Open Gregcake opened this issue 8 years ago • 6 comments

Hi,

Trying to pull some insights off the ads api, broken down on a daily level. Whenever I specify the time_range parameter, I'll get a status 500 response with error subcode 99. Not sure what this means or how to rectify it.

`Traceback (most recent call last): File "main.py", line 107, in insights = account.get_insights(params=params) File "C:\Users\you.yang.gregory.tan\Desktop\API\Facebook\facebookads\adobjects\adaccount.py", line 1639, in get_insights return request.execute() File "C:\Users\you.yang.gregory.tan\Desktop\API\Facebook\facebookads\api.py", line 657, in execute cursor.load_next_page() File "C:\Users\you.yang.gregory.tan\Desktop\API\Facebook\facebookads\api.py", line 801, in load_next_page params=self.params, File "C:\Users\you.yang.gregory.tan\Desktop\API\Facebook\facebookads\api.py", line 330, in call raise fb_response.error() facebookads.exceptions.FacebookRequestError:

Message: Call was not successful Method: GET Path: https://graph.facebook.com/v2.11/act_1430511713688677/insights Params: {'time_range': '{"since":"2018-01-30","until":"2018-01-31"}', 'fields': '["account_id","account_name","ad_id","ad_name","actions","campaign_id","campaign_name","reach","impressions","inline_post_engagement","clicks","cpc","ctr","cpm","cost_per_inline_post_engagement","cost_per_10_sec_video_view","cost_per_total_action","place_page_name"]', 'breakdowns': '["publisher_platform","platform_position"]', 'time_increment': 1, 'level': 'ad'}

Status: 500 Response: { "error": { "message": "An unknown error occurred", "code": 1, "error_subcode": 99 } }`

params = { 'level': 'ad', 'fields': ['account_id', 'account_name', 'ad_id', 'ad_name', 'actions', 'campaign_id', 'campaign_name', 'reach', 'impressions', 'inline_post_engagement', 'clicks', 'cpc', 'ctr', 'cpm', 'cost_per_inline_post_engagement', 'cost_per_10_sec_video_view', 'cost_per_total_action', 'place_page_name'], 'breakdowns':['publisher_platform', 'platform_position'], 'time_increment':1, 'time_range': {'since': '2018-01-30','until': '2018-01-31'} }

Gregcake avatar Feb 08 '18 08:02 Gregcake

I am receiving exactly the same error if i try to pull some insights off the facebook ads api since 27th of Feb 2018. The same code was working absolutely fine before 27th of Feb 2018. The error status is 500 and after a bit of research i got to know that its the server side error which I am quite not sure of. Below you can see the log of the error which i am getting.

Facebook logging: API bootstrap successfull. Accounts loaded successfully. <class 'facebookads.exceptions.FacebookRequestError'> Message: Call was not successful Method: GET
Path: https://graph.facebook.com/v2.10/act_1459815497630046/insights Params: {'fields': 'account_name,campaign_name,adset_name,ad_name,spend', 'breakdowns': '["region"]', 'level': 'ad', 'time_increment': 1, 'time_range': '{"since":"2018-02-27","until":"2018-03-16"}'} Status: 500
Response: {
"error": { "message": "An unknown error occurred",
"code": 1, "error_subcode": 99
}
}'

If somebody knows how to solve this issue please do let us know.

chandrasendr avatar Mar 16 '18 08:03 chandrasendr

I getting the same issue here as well, I believe all fields mentioned can be grabbed at all levels {ad, adset, campaign, account }. Just making sure level isnt a problem here.

rupesh1219 avatar May 07 '18 22:05 rupesh1219

The problem is a timeout, but I don't know why the response is error 500. I have the same problem when I'm trying to pull data on ad level.

matiasbeltramone avatar Jun 18 '18 16:06 matiasbeltramone

It seems like this issue has been open for more than a few months now. We have made many changes in the SDK since then, including releasing a new version. If you can repro your specific issue with the latest version of the SDK, please create a new issue or comment here with further details.

codytwinton avatar Aug 13 '18 20:08 codytwinton

Got same error on version '3.1.1'.

Using Python client, facebook_business got:

Message: Call was not successful
Method:  GET
Path:    https://graph.facebook.com/v3.1/act_1421944777889456/campaigns
Params:  {'fields': 'name,id,account_id,spend_cap,objective,start_time,stop_time,status', 'encoding': 'iso-8859-1', 'summary': 'true'}

Status:  500
Response:
  {
    "error": {
      "message": "An unknown error occurred", 
      "code": 1, 
      "error_subcode": 99
    }
  }

Gocht avatar Sep 10 '18 21:09 Gocht

Hey, thanks for your comment! This is actually an api issue. Please report the issue on Devsite Bug Report channel: https://developers.facebook.com/support/bugs/ Thanks!

jingping2015 avatar Sep 10 '18 21:09 jingping2015