Home Ask Login Register

Developers Planet

Your answer is one click away!

Ugur Gungezerler February 2016

object_story_spec spec must be an associative array

I wanna create a creative with api. When i post object_story_spec parameter, i got this error 'Creative spec must be an associative array (optionally json-encoded)'

this is my json value it is 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/" }}



Nadeem0035 February 2016

It should be like something.

                    "page_id": "<PAGE_ID>", 
                    "video_data": { 
                      "call_to_action": {"type":"LIKE_PAGE","value":{"page":"<PAGE_ID>"}}, 
                      "description": "try it out", 
                      "image_url": "<THUMBNAIL_URL>", 
                      "video_id": "<VIDEO_ID>" 


$object_story_spec = new ObjectStorySpec();
            ObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
            ObjectStorySpecFields::LINK_DATA => <LINK_DATA>,

 $creative = new AdCreative(null, 'ad_Acount_id');
            AdCreativeFields::NAME => 'Sample Creative',
            AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,

Post Status

Asked in February 2016
Viewed 1,437 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life