facebook / facebook-java-business-sdk

Java SDK for Meta Marketing APIs

Home Page:https://developers.facebook.com/docs/business-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When creating cross channel optimization ads, object store urls is required in ad's creative's call to action

SteveJu1 opened this issue · comments

commented

Which SDK version are you using?

16.0

What's the issue?

ad and adcreative param is setted,but result is below.

com.facebook.ads.sdk.APIException$FailedRequestException: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":1359187,"is_transient":false,"error_user_title":"Missing Object Store Urls For Cross Channel Optimization Ads","error_user_msg":"When creating cross channel optimization ads, object store urls is required in ad's creative's call to action.","fbtrace_id":"ABOLBxRZcdEhigrs-UkyJde"}}

Steps/Sample code to reproduce the issue

param is

    AdCreative adCreative = account.createAdCreative()
                .setName("测试标题")
                .setActorId("106058345276245")
                .setApplinkTreatment(AdCreative.EnumApplinkTreatment.VALUE_AUTOMATIC)
                .setBody("『超強磁力落下防")
                .setInstagramActorId("4586881281389023") //
                .setInstagramUserId("17841450871364493")
                .setTitle("特別価格868円 ")
                .setObjectType("VIDEO")
                .setObjectStorySpec(getAdCreativeObjectStorySpec1())
                .setOmnichannelLinkSpec(getOmnichannelLinkSpec())
                .setUsePageActorOverride(false)
                .execute()
private static AdCreativeObjectStorySpec getAdCreativeObjectStorySpec1() {
    AdCreativeObjectStorySpec objectStorySpec = new AdCreativeObjectStorySpec()
            .setFieldInstagramActorId("4586881281389023")
            .setFieldPageId("106058345276245")
            .setFieldLinkData(linkData());
    return objectStorySpec;
} 
private static AdCreativeLinkData linkData() {
    AdCreativeLinkDataCallToAction callToAction = new AdCreativeLinkDataCallToAction();
    callToAction.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_LEARN_MORE);AdCreativeLinkData linkData = new AdCreativeLinkData();
    linkData.setFieldCallToAction(callToAction)
            .setFieldLink("https://www.7sgood.com/att/index.html?attr_page=landing&at_token=1%3A%2F%20JL375%201970101%20%241%201w626ASyI2S")
            .setFieldName("sample creative") ;
    return linkData;
}

Observed Results:

  • What happened? This could be a description, log output, etc.

Expected Results:

  • What did you expect to happen?
    create ad success

Could you check this documentation https://developers.facebook.com/docs/ccco/

same error