I am new to facebook API, I was looking through the code given here with example so I have been calling script for AdsInsightsEdgeAdCampaignInsights.py
by replacing the credential related variables . But I am getting an error as follows :
Message: Call was not successful
Method: GET
Path: https://graph.facebook.com/v2.11/10153882624547484/insights
Params: {'breakdown': 'publisher_platform', 'fields': 'impressions'}
Status: 400
Response:
{
"error": {
"message": "Unsupported operation",
"code": 100,
"type": "OAuthException",
"fbtrace_id": "A/HinNJOAqs"
}
}
I have following queries:
why it is calling
https://graph.facebook.com/v2.11/10153882624547484/insights
, why versionv2.11
?How should I call using API version
v3.1
?Any Python Facebook API documentation for v3.1
Hej Piyush,
I think it is calling v2.11 instead of v3.1 because in the import statement for
AdsInsightsEdgeAdCampaignInsights.py
, it callsfrom facebookads
where as from v3.0 onwards, Facebook merged all the Advertiser & Business APIs and called the modulefacebook_business
.I tested it for myself and after changing it to
it worked for me.
When it comes to the documentation of their own API and updating it properly, Facebook is pretty sloppy in my opinion.