Search code examples
facebookfacebook-marketing-api

How to access "Headlines" and "Newsfeed" in FB AdCreative Marketing API?


In the Power Editor, while creating ad, (Traffic based campaigns), there is an option to edit "headlines" and "news feed link description" (Screenshot attached). I cannot find the corresponding fields in the Creative API. I'm able to add the link and message though.

Here is a sample code:

link_data = AdCreativeLinkData()
link_data[AdCreativeLinkData.Field.message] = row['Message']
link_data[AdCreativeLinkData.Field.link] = row['Link']
link_data['Headline'] = row['Headline'] # <<<< NOT AVAILABLE
link_data['News Feed'] = row['News_feed'] # <<<< NOT AVAILABLE
link_data[AdCreativeLinkData.Field.image_hash] = img_hash

object_story_spec = AdCreativeObjectStorySpec()
object_story_spec[AdCreativeObjectStorySpec.Field.page_id] = config['page_id']
object_story_spec[AdCreativeObjectStorySpec.Field.link_data] = link_data

creative = AdCreative(parent_id=ad_account_id)
creative[AdCreative.Field.name] = 'AdCreative for Link Ad'
creative[AdCreative.Field.object_story_spec] = object_story_spec
creative.remote_create()

print(creative)

Any suggestions how to access the fields? Can it be done using curl? Power Editor for Ads


Solution

  • I found the following fields which affect headline and news feed:

        link_data[AdCreativeLinkData.Field.name] = "test headline"
        link_data[AdCreativeLinkData.Field.description] = "description test"