facebook - object_story_spec spec must be an associative array -
i wanna create creative api. when post object_story_spec parameter, got error 'creative spec must associative array (optionally json-encoded)'
this json value valid.
{ "page_id" : "103830656322074", "link_data": { "call_to_action": {"type":"learn_more","value":{"link":"facebook.com/"}}, "caption": "reklam #1", "name": "reklam #1", "link": "facebook.com/", "message": "facebook.com/" }}
developers.facebook.com/docs/marketing-api/reference/ad-creative#creating
it should something.
object_story_spec={ "page_id": "<page_id>", "video_data": { "call_to_action": {"type":"like_page","value":{"page":"<page_id>"}}, "description": "try out", "image_url": "<thumbnail_url>", "video_id": "<video_id>" } } or $object_story_spec = new objectstoryspec(); $object_story_spec->setdata(array( objectstoryspecfields::page_id => <page_id>, objectstoryspecfields::link_data => <link_data>, )); $creative = new adcreative(null, 'ad_acount_id'); $creative->setdata(array( adcreativefields::name => 'sample creative', adcreativefields::object_story_spec => $object_story_spec, ));
Comments
Post a Comment