'Facebook Marketing API create Ad Creatives Error
I'm having issues creating Ad Creatives using:
gem 'facebookbusiness'
Facebook API version 13.0
I have successfully managed to upload Ad Images and to get the image URL and image hash in return.
The error happens when trying to create the Ad Creatives
creative = @ad_account.adcreatives.create({
title: 'My Page Like Ad',
body: 'Like My Page',
object_url: 'www.facebook.com',
link_url: 'www.facebook.com',
image_url: image[0]['url'],
image_hash: image[0]['hash'],
})
I get this error:
FacebookAds::ClientError in Admins::AdsController
Invalid parameter: Missing Image (fbtrace_id: Ao0FDSCOwt9ss_5W6CmNyhx)
Solution 1:[1]
you should special in field object_story_spec,not in image_hash
final AdCreativeObjectStorySpec objectStorySpec = new AdCreativeObjectStorySpec()
.setFieldVideoData(new AdCreativeVideoData()
.setFieldVideoId(video.getFieldId())
.setFieldImageHash(image.getFieldHash())
.setFieldCallToAction(callToAction))
.setFieldPageId(String.valueOf(page.getId()));
account.createAdCreative()
.setObjectStorySpec(objectStorySpec);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | zhao |
