facebook / facebook-java-business-sdk

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

facebook-java-business-sdk does not support v14 yet #390

Closed jessearaujodone closed 1 year ago

jessearaujodone commented 2 years ago

Which SDK version are you using?

version 12.0.0

What's the issue?

I create a new application on developer and in my request i get the error: You are calling a deprecated version of the Ads API. Please update to the latest version: v14.0. But v14 doesn't exist!!!

Steps/Sample code to reproduce the issue

Observed Results:

Expected Results:

dpalic commented 2 years ago

Having the same issue. having the same issue here.

What are the plans to upgrade to latest v14 version?

Also wondering, because as of https://developers.facebook.com/docs/graph-api/changelog/

v12 and v13 shall work still? But this API is throwing

Exception in thread "main" java.lang.RuntimeException: com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"(#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v14.0.","type":"OAuthException","code":2635

how to use the older API still?

jessearaujodone commented 2 years ago

@dpalic I try contact with account manager of facebook. But still without answer.

But I solved problem download official sdk, alter code of https://github.com/facebook/facebook-java-business-sdk/blob/main/src/main/java/com/facebook/ads/sdk/APIConfig.java

I made this change: public static final String DEFAULT_API_VERSION = "v14.0";

And maven clean install.

After that a change facebook sdk to local dependency to path to a custom .jar

kataku commented 2 years ago

Sorry to pile on but same. I get that there may be some lag time between API releases and SDK releases but can we get some idea of when we can expect it? I need this for work and right now i can't run my code at all. Maybe don't deprecate the previous API version until the SDK's are ready?

dpalic commented 2 years ago

the problem ist not the lag of release of SDK

IMHO it is a bug, that the API is not conforming to this release plans From the Changelog the APIs shall be still available back to the version v8.0 and thus this code shall still work and produce a maximun a warning. The code is failing instead, which makes the code useless and not like it should be, to stay working with older API versions

kataku commented 2 years ago

@dpalic so it looks like all api end points before v14 return 400 with the update message. So its more than a warning, the API's before v14 straight up don't work anymore. The latest version of the SDK points to v13 so it is absolutely that the SDK isn't up to date.

So I pulled the github code and made the change @jessearaujodone suggested and the API calls now work and are hitting https://graph.facebook.com/v14.0/

That said now I have a new issue where all the SDK classes have an issue of the form

"The return type is incompatible with APINode.parseResponse(String, APIContext, APIRequest, String)"

Anyone have any ideas?

Its the same code as the working (but api error having) maven dependency v13 with that one change to fix the api version to 14 so it must be something to do with the way I am building/compiling it but so far i can't figure it out.

Meanwhile i hope the maintainers release a new version of the SDK OR Facebook let the v13 API endpoint work again. I assume they disabled them in a hurry due to some vulnerability so maybe little hope there. The App settings on the facebook side don't let you set anything other than v14 either :(

kataku commented 2 years ago

Seems someone else had this issue with the API a long time ago but there's little hint how to fix it there :(

https://github.com/facebook/facebook-java-business-sdk/issues/168

Full error i get after the API call works:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: The return type is incompatible with APINode.parseResponse(String, APIContext, APIRequest, String)

at com.facebook.ads.sdk.AdsInsights.parseResponse(AdsInsights.java:347)
at com.facebook.ads.sdk.AdAccount$APIRequestGetInsights.parseResponse(AdAccount.java:18465)
at com.facebook.ads.sdk.AdAccount$APIRequestGetInsights.execute(AdAccount.java:18476)
at com.facebook.ads.sdk.AdAccount$APIRequestGetInsights.execute(AdAccount.java:18470)
at metaConnector.Sandbox.main(Sandbox.java:27)
kataku commented 2 years ago

Hmm it comes up again here: #242

Again no useful response :(

jubin-admaxlocal commented 2 years ago

Having the same issue here. created a Facebook app recently which will only allow selecting v14.0 in App settings. Because of this, I'm not able to use facebook-java-business-sdk for api integration. Error : com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"(#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v14.0.","type":"OAuthException","code":2635,"fbtrace_id":"AlNBccQ86OvU2QsA20Vn17O"}}

When we can expect v14 version support in facebook-java-business-sdk ?