Skip to content

Why are the IDs returned the same? #499

@fatcatmaster

Description

@fatcatmaster

When I create multiple different creatives in a loop, the creative IDs returned are the same.

version: v24.0

example code:

`

public static void create() throws Exception {
    for (int i = 0; i < 3; i++) {
        String accessToken = "";
        String pageId = "";
        String adAccountId = "";
        APIContext context = new APIContext(accessToken).enableDebug(false);
        AdAccount.APIRequestCreateAdCreative creativeRequest = new AdAccount(adAccountId, context)
                .createAdCreative()
                .setName("name-"+i+"-"+System.currentTimeMillis())
                .setTitle("name-"+i+"-"+System.currentTimeMillis())
                .setObjectStorySpec(new AdCreativeObjectStorySpec()
                        .setFieldPageId(pageId)
                        .setFieldLinkData(new AdCreativeLinkData()
                                .setFieldLink("https://www.123.cn/")
                                .setFieldMessage("")
                                .setFieldName("")
                                .setFieldDescription("")));
        AdCreative creative = creativeRequest.execute();
        System.out.println("ID: " + creative.getFieldId());
    }
}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions