skip to Main Content

I’m creating an adset via posting to adsets endpoint (Marketing API).
It is returning me the following error:

{
  "error": {
    "message": "An unknown error occurred",
    "type": "OAuthException",
    "code": 1,
    "error_subcode": 1815652,
    "is_transient": false,
    "error_user_title": "Missing Messenger Destination in Child Item",
    "error_user_msg": "To use Messenger as destination, all children     items in the carousel ads should have messenger destination.",
    "fbtrace_id": "AdulKVKescc"
  }
}

The creative is a carousel.
Each of the children (cards) of the carousel has got proper call_to_action, which is '{type:"LEARN_MORE",value:{app_destination:"MESSENGER"}}'

I’ve tried various combinations of putting link and not putting a link in the child elements. I also tried putting a m.me link, but that throws a different error while creating the creative itself.

I’m using adcreatives endpoint to create my creatives…

Any guidelines on what should be the link value be? Facebook Documentation says it is ignored. If ignored, why the error?

2

Answers


  1. The error is a bit misleading, because the child_attachments all contain the call_to_action, but you must also add the same call_to_action to the creative in link_data or video_data (depending on type of creative).

    Login or Signup to reply.
  2. Add call_to_action to link_data. Credit Chris Simmons

    # use picture or image_hash
    fb_dummy_image = 'https://i.ytimg.com/vi/eGKWS6_187s/maxresdefault.jpg'
    image_hash = "164d943385c130d64e702664c9ab1798"
    
    data = {
        "access_token": SELLIO_AD_SERVER_TOKEN,
        "name": "Sample Creative",
        "object_story_spec": {
            "link_data": {
            "call_to_action": {"type": "LEARN_MORE", "value": {"app_destination": "MESSENGER"}},
                "child_attachments": [
                    {
                        "description": "$800.99",
                        "image_hash": image_hash,
                        "link": "https://www.example.com",
                        "name": "A1",
                        "call_to_action": {
                            "type": "LEARN_MORE",
                            "value": {
                                "app_destination": "MESSENGER",
                            }
                        },
                    },
                    {
                        "description": "$400.99",
                        "image_hash": image_hash,
                        "link": "https://www.example.com",
                        "name": "A2",
                        "call_to_action": {
                            "type": "LEARN_MORE",
                            "value": {
                                "app_destination": "MESSENGER",
                            }
                        },
                    },
                    {
                        "description": "$300.99",
                        "picture": fb_dummy_image,
                        "link": "https://www.messenger.com/t/xxxxxxxxxxxx",
                        "name": "A3",
                        "call_to_action": {
                            "type": "LEARN_MORE",
                            "value": {
                                "app_destination": "MESSENGER",
                            }
                        }
                    }
                ],
                "link": "https://www.messenger.com/t/xxxxxxxxxx",
                "page_welcome_message": '{"user_edit": true, "message": {"attachment": {"type": "template", "payload": {"template_type": "generic", "elements": [{"buttons": [{"url": "http://www.example.com/", "type": "web_url", "title": "View Website"}, {"type": "postback", "payload": "USER_DEFINED_PAYLOAD", "title": "Start Chatting"}], "subtitle": "Optional: Enter a subtitle to provide more information", "image_url": "https://image.ibb.co/bz5t6Q/placeholder.png", "title": "Enter a title to accompany your image"}, {"buttons": [{"url": "http://www.example.com/", "type": "web_url", "title": "View Website"}, {"type": "postback", "payload": "USER_DEFINED_PAYLOAD", "title": "Start Chatting"}], "subtitle": "2nd product", "image_url": "https://image.ibb.co/bz5t6Q/placeholder.png", "title": "a2"}, {"buttons": [{"url": "http://www.example.com/", "type": "web_url", "title": "View Website"}, {"type": "postback", "payload": "USER_DEFINED_PAYLOAD", "title": "Start Chatting"}], "subtitle": "3rd product", "image_url": "https://image.ibb.co/bz5t6Q/placeholder.png", "title": "a3"}]}}}}'
            },
            "page_id": "xxxxxxxxxxx"
        }
    }
    

    Then also make an ad campaign with MESSAGES as the objective

    def create_campaign(ad_account_id, campaign_name):
    my_account = AdAccount(ad_account_id)
    campaign = Campaign(parent_id=my_account.get_id_assured())
    
    campaign.update({
        Campaign.Field.name: campaign_name,
        Campaign.Field.objective: 'MESSAGES'
    })
    
    campaign.remote_create(params={
        'status': Campaign.Status.paused,
    })
    logging.debug(campaign)
    return campaign.get_id()
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search