facebook / facebook-java-business-sdk

Java SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
402 stars 332 forks source link

Fetching Campaign by ID throwing error: "error":{"message":"(#100) Tried accessing nonexisting field (benchmark_report_count) on node type (Campaign)","type":"OAuthException","code":100}} #410

Closed gotham3 closed 1 year ago

gotham3 commented 1 year ago

Which SDK version are you using?

v15.0

What's the issue?

Earlier when fetching campaign by ID returned the campaign object. Campaign campaign = Campaign.fetchById(facebookCampaignId, adAccount.getContext());

Steps/Sample code to reproduce the issue

Campaign campaign = Campaign.fetchById(facebookCampaignId, adAccount.getContext());

Observed Results:

Expected Results:

jinghuan-fb commented 1 year ago

The error message has indicated benchmark_report_count doesn't exist. So you need to remove it from list of fields.

gotham3 commented 1 year ago

But we are not requesting for any specific field. We're just using this function: Campaign.fetchById(facebookCampaignId, adAccount.getContext()) in the SDK there is a field called benchmark_report_count. And this same function is working in v14.0

stcheng commented 1 year ago

Could you check if you are using the latest version (15.0.2) of the SDK? The field benchmark_report_count has been removed from the class. link

If you still encounter this issue using the latest version of SDK, please file a bug here https://developers.intern.facebook.com/support/bugs/.