Campaign created successfully,but when create adset,response:com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_data":"{\"blame_field_specs\":[[\"optimization_goal\"]]}","error_subcode":2490408,"is_transient":false,"error_user_title":"\u6210\u6548\u76ee\u6807\u4e0d\u53ef\u7528","error_user_msg":"\u5e7f\u544a\u76ee\u6807\u4e0d\u652f\u6301\u9009\u4e2d\u7684\u6210\u6548\u76ee\u6807\u3002\u8bf7\u53e6\u9009\u76ee\u6807\uff0c\u6216\u7f16\u8f91\u5e7f\u544a\u7cfb\u5217\u3002","fbtrace_id":"AqmV8CUdtJHXr2MOUl4l8cS"}}
com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_data":"{\"blame_field_specs\":[[\"optimization_goal\"]]}","error_subcode":2490408,"is_transient":false,"error_user_title":"\u6210\u6548\u76ee\u6807\u4e0d\u53ef\u7528","error_user_msg":"\u5e7f\u544a\u76ee\u6807\u4e0d\u652f\u6301\u9009\u4e2d\u7684\u6210\u6548\u76ee\u6807\u3002\u8bf7\u53e6\u9009\u76ee\u6807\uff0c\u6216\u7f16\u8f91\u5e7f\u544a\u7cfb\u5217\u3002","fbtrace_id":"AqmV8CUdtJHXr2MOUl4l8cS"}}
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:313) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.facebook.ads.sdk.APIRequest.access$100(APIRequest.java:54) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.sendPost(APIRequest.java:592) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.execute(APIRequest.java:524) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.facebook.ads.sdk.APIRequest.executeInternal(APIRequest.java:199) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdSet.execute(AdAccount.java:8346) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdSet.execute(AdAccount.java:8341) ~[facebook-java-business-sdk-17.0.3.jar:?]
at com.aliencloud.mktapi.facebook.api.AdOperateSDKServiceApi.createSet(AdOperateSDKServiceApi.java:206) ~[classes/:?]
at com.aliencloud.admin.service.impl.MarketingApiServiceImpl.createSet(MarketingApiServiceImpl.java:440) ~[classes/:?]
at com.aliencloud.admin.service.marketing.FacebookMarketingServiceImpl.createSet(FacebookMarketingServiceImpl.java:288) ~[classes/:?]
at com.aliencloud.admin.service.impl.FacebookAdOperateServiceImpl.createSet(FacebookAdOperateServiceImpl.java:869) ~[classes/:?]
at com.aliencloud.admin.service.impl.FacebookAdOperateServiceImpl$$FastClassBySpringCGLIB$$d8e76e7d.invoke() ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.16.jar:5.3.16]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.3.16.jar:5.3.16]
at com.aliencloud.admin.service.impl.FacebookAdOperateServiceImpl$$EnhancerBySpringCGLIB$$689e06ac.createSet() ~[classes/:?]
at com.aliencloud.admin.task.marketing.facebook.FacebookAdCreateTask.doExecute(FacebookAdCreateTask.java:144) ~[classes/:?]
at com.aliencloud.admin.task.AbstractTask.execute(AbstractTask.java:57) ~[classes/:?]
at com.aliencloud.admin.task.ParentTask.lambda$doExecute$0(ParentTask.java:37) ~[classes/:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1590) [?:1.8.0_101]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://graph.facebook.com/v17.0/act_xxxxxxxxxxxxxxxxxx/adsets
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_101]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1890) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1885) ~[?:1.8.0_101]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1884) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1457) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[?:1.8.0_101]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) ~[?:1.8.0_101]
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:292) ~[facebook-java-business-sdk-17.0.3.jar:?]
... 22 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://graph.facebook.com/v17.0/act_xxxxxxxxxxxxxxxxxx/adsets
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[?:1.8.0_101]
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[?:1.8.0_101]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) ~[?:1.8.0_101]
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:289) ~[facebook-java-business-sdk-17.0.3.jar:?]
... 22 more
Which SDK version are you using?
17.0.3
What's the issue?
Campaign created successfully,but when create adset,response:com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_data":"{\"blame_field_specs\":[[\"optimization_goal\"]]}","error_subcode":2490408,"is_transient":false,"error_user_title":"\u6210\u6548\u76ee\u6807\u4e0d\u53ef\u7528","error_user_msg":"\u5e7f\u544a\u76ee\u6807\u4e0d\u652f\u6301\u9009\u4e2d\u7684\u6210\u6548\u76ee\u6807\u3002\u8bf7\u53e6\u9009\u76ee\u6807\uff0c\u6216\u7f16\u8f91\u5e7f\u544a\u7cfb\u5217\u3002","fbtrace_id":"AqmV8CUdtJHXr2MOUl4l8cS"}}
Steps/Sample code to reproduce the issue
Campaign objective:OUTCOME_SALES AdSet optimization_goal:LANDING_PAGE_VIEWS
Observed Results:
com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_data":"{\"blame_field_specs\":[[\"optimization_goal\"]]}","error_subcode":2490408,"is_transient":false,"error_user_title":"\u6210\u6548\u76ee\u6807\u4e0d\u53ef\u7528","error_user_msg":"\u5e7f\u544a\u76ee\u6807\u4e0d\u652f\u6301\u9009\u4e2d\u7684\u6210\u6548\u76ee\u6807\u3002\u8bf7\u53e6\u9009\u76ee\u6807\uff0c\u6216\u7f16\u8f91\u5e7f\u544a\u7cfb\u5217\u3002","fbtrace_id":"AqmV8CUdtJHXr2MOUl4l8cS"}} at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:313) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.facebook.ads.sdk.APIRequest.access$100(APIRequest.java:54) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.sendPost(APIRequest.java:592) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.execute(APIRequest.java:524) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.facebook.ads.sdk.APIRequest.executeInternal(APIRequest.java:199) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdSet.execute(AdAccount.java:8346) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdSet.execute(AdAccount.java:8341) ~[facebook-java-business-sdk-17.0.3.jar:?] at com.aliencloud.mktapi.facebook.api.AdOperateSDKServiceApi.createSet(AdOperateSDKServiceApi.java:206) ~[classes/:?] at com.aliencloud.admin.service.impl.MarketingApiServiceImpl.createSet(MarketingApiServiceImpl.java:440) ~[classes/:?] at com.aliencloud.admin.service.marketing.FacebookMarketingServiceImpl.createSet(FacebookMarketingServiceImpl.java:288) ~[classes/:?] at com.aliencloud.admin.service.impl.FacebookAdOperateServiceImpl.createSet(FacebookAdOperateServiceImpl.java:869) ~[classes/:?] at com.aliencloud.admin.service.impl.FacebookAdOperateServiceImpl$$FastClassBySpringCGLIB$$d8e76e7d.invoke() ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.16.jar:5.3.16]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.3.16.jar:5.3.16]
at com.aliencloud.admin.service.impl.FacebookAdOperateServiceImpl$$EnhancerBySpringCGLIB$$689e06ac.createSet() ~[classes/:?]
at com.aliencloud.admin.task.marketing.facebook.FacebookAdCreateTask.doExecute(FacebookAdCreateTask.java:144) ~[classes/:?]
at com.aliencloud.admin.task.AbstractTask.execute(AbstractTask.java:57) ~[classes/:?]
at com.aliencloud.admin.task.ParentTask.lambda$doExecute$0(ParentTask.java:37) ~[classes/:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1590) [?:1.8.0_101]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://graph.facebook.com/v17.0/act_xxxxxxxxxxxxxxxxxx/adsets
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_101]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1890) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1885) ~[?:1.8.0_101]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1884) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1457) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[?:1.8.0_101]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) ~[?:1.8.0_101]
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:292) ~[facebook-java-business-sdk-17.0.3.jar:?]
... 22 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://graph.facebook.com/v17.0/act_xxxxxxxxxxxxxxxxxx/adsets
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840) ~[?:1.8.0_101]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[?:1.8.0_101]
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[?:1.8.0_101]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) ~[?:1.8.0_101]
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:289) ~[facebook-java-business-sdk-17.0.3.jar:?]
... 22 more
Expected Results:
AdSet created successfully