Incomplete Tweets' preview generated

tweet-preview
api

#1

Hello,

I’m experiencing an issue with the following endpoint to generate Tweets’ preview:

{
    "url": "https:\/\/ads-api.twitter.com\/2\/accounts\/18ce54fxokc\/tweet\/preview\/950692821840916480",
    "method": "GET",
    "parameters": {
        "preview_target": "TWITTER_TIMELINE"
    }
}

We’re getting the following result:

{
    "data": [
        {
            "platform": "web",
            "preview": "<!DOCTYPE html> <html> <head>   <meta charset=\"utf-8\" \/>      <link href=\"https:\/\/ton.twimg.com\/macaw-campaigns\/css\/tweet_preview.bundle.28d222661f801ddf2a5d.css\" rel=\"stylesheet\" \/> <\/head>  <body>       <div class=\"Tweet--timeline   Tweet   Tweet--web          \"  data-tweet-id=\"950692821840916480\">    <img class=\"Tweet-avatar\" src=\"https:\/\/pbs.twimg.com\/profile_images\/566393580982255617\/nOJkVxgm_normal.png\" width=\"48\" height=\"48\" alt=\"\"\/>    <div class=\"Tweet-body\">     <div class=\"Tweet-header\">       <div class=\"Tweet-userData\">         <a href=\"https:\/\/twitter.com\/FisherInvestES\" target=\"_blank\" class=\"Tweet-userLink\">           <span class=\"Tweet-name\">Fisher InvestmentsES<\/span>                            <span class=\"Tweet-screenName\">@FisherInvestES<\/span>         <\/a>       <\/div>        <span class=\"Tweet-timeLabel\">         <a class=\"Tweet-timestamp\" href=\"https:\/\/twitter.com\/FisherInvestES\/status\/950692821840916480\" target=\"_blank\" data-time=\"1515497806\">           09 ene.         <\/a>       <\/span>      <\/div>         <div class=\"Tweet-text \" dir=\"\">\u00bfC\u00f3mo decide qu\u00e9 acciones debe vender?<\/div>           <div class=\"CardContainer   CardContainer--timeline       CardContainer--web    \" >                <\/div>       <\/div>     <div class=\"Tweet-footer\">         <div class=\"Tweet-actions \">   <button class=\"Tweet-action Tweet-action--reply\" type=\"button\">     <span class=\"Icon Icon--reply\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--retweet\" type=\"button\">     <span class=\"Icon Icon--retweet\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--favorite Tweet-action--like\" type=\"button\">     <span class=\"Icon Icon--heart\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--dm\" type=\"button\">     <span class=\"Icon Icon--dm\"><\/span>   <\/button> <\/div>             <div class=\"Tweet-context Tweet-context--promotion\">   <div class=\"Tweet-badge Tweet-badge--promotedBy\">      <span class=\"Icon Icon--promoted\"><\/span>      <span class=\"Tweet-badgeText\">Promocionado<\/span>   <\/div> <\/div>    <\/div> <\/div>   <\/body> <\/html> "
        },
        {
            "platform": "android",
            "preview": "<!DOCTYPE html> <html> <head>   <meta charset=\"utf-8\" \/>      <link href=\"https:\/\/ton.twimg.com\/macaw-campaigns\/css\/tweet_preview.bundle.28d222661f801ddf2a5d.css\" rel=\"stylesheet\" \/> <\/head>  <body>       <div class=\"Tweet--timeline   Tweet   Tweet--android          \"  data-tweet-id=\"950692821840916480\">    <img class=\"Tweet-avatar\" src=\"https:\/\/pbs.twimg.com\/profile_images\/566393580982255617\/nOJkVxgm_normal.png\" width=\"48\" height=\"48\" alt=\"\"\/>    <div class=\"Tweet-body\">     <div class=\"Tweet-header\">       <div class=\"Tweet-userData\">         <a href=\"https:\/\/twitter.com\/FisherInvestES\" target=\"_blank\" class=\"Tweet-userLink\">           <span class=\"Tweet-name\">Fisher InvestmentsES<\/span>                            <span class=\"Tweet-screenName\">@FisherInvestES<\/span>         <\/a>       <\/div>        <span class=\"Tweet-timeLabel\">         <a class=\"Tweet-timestamp\" href=\"https:\/\/twitter.com\/FisherInvestES\/status\/950692821840916480\" target=\"_blank\" data-time=\"1515497806\">           09 ene.         <\/a>       <\/span>      <\/div>         <div class=\"Tweet-text \" dir=\"\">\u00bfC\u00f3mo decide qu\u00e9 acciones debe vender?<\/div>           <div class=\"CardContainer   CardContainer--timeline       CardContainer--android    \" >                <\/div>       <\/div>     <div class=\"Tweet-footer\">         <div class=\"Tweet-actions \">   <button class=\"Tweet-action Tweet-action--reply\" type=\"button\">     <span class=\"Icon Icon--reply\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--retweet\" type=\"button\">     <span class=\"Icon Icon--retweet\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--favorite Tweet-action--like\" type=\"button\">     <span class=\"Icon Icon--heart\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--dm\" type=\"button\">     <span class=\"Icon Icon--dm\"><\/span>   <\/button> <\/div>             <div class=\"Tweet-context Tweet-context--promotion\">   <div class=\"Tweet-badge Tweet-badge--promotedBy\">      <span class=\"Icon Icon--promoted\"><\/span>      <span class=\"Tweet-badgeText\">Promocionado<\/span>   <\/div> <\/div>    <\/div> <\/div>   <\/body> <\/html> "
        },
        {
            "platform": "iphone",
            "preview": "<!DOCTYPE html> <html> <head>   <meta charset=\"utf-8\" \/>      <link href=\"https:\/\/ton.twimg.com\/macaw-campaigns\/css\/tweet_preview.bundle.28d222661f801ddf2a5d.css\" rel=\"stylesheet\" \/> <\/head>  <body>       <div class=\"Tweet--timeline   Tweet   Tweet--iphone          \"  data-tweet-id=\"950692821840916480\">    <img class=\"Tweet-avatar\" src=\"https:\/\/pbs.twimg.com\/profile_images\/566393580982255617\/nOJkVxgm_normal.png\" width=\"48\" height=\"48\" alt=\"\"\/>    <div class=\"Tweet-body\">     <div class=\"Tweet-header\">       <div class=\"Tweet-userData\">         <a href=\"https:\/\/twitter.com\/FisherInvestES\" target=\"_blank\" class=\"Tweet-userLink\">           <span class=\"Tweet-name\">Fisher InvestmentsES<\/span>                            <span class=\"Tweet-screenName\">@FisherInvestES<\/span>         <\/a>       <\/div>        <span class=\"Tweet-timeLabel\">         <a class=\"Tweet-timestamp\" href=\"https:\/\/twitter.com\/FisherInvestES\/status\/950692821840916480\" target=\"_blank\" data-time=\"1515497806\">           09 ene.         <\/a>       <\/span>      <\/div>         <div class=\"Tweet-text \" dir=\"\">\u00bfC\u00f3mo decide qu\u00e9 acciones debe vender?<\/div>           <div class=\"CardContainer   CardContainer--timeline       CardContainer--iphone    \" >                <\/div>       <\/div>     <div class=\"Tweet-footer\">         <div class=\"Tweet-actions \">   <button class=\"Tweet-action Tweet-action--reply\" type=\"button\">     <span class=\"Icon Icon--reply\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--retweet\" type=\"button\">     <span class=\"Icon Icon--retweet\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--favorite Tweet-action--like\" type=\"button\">     <span class=\"Icon Icon--heart\"><\/span>     <span class=\"Tweet-actionCount\">##<\/span>   <\/button>   <button class=\"Tweet-action Tweet-action--dm\" type=\"button\">     <span class=\"Icon Icon--dm\"><\/span>   <\/button> <\/div>             <div class=\"Tweet-context Tweet-context--promotion\">   <div class=\"Tweet-badge Tweet-badge--promotedBy\">      <span class=\"Icon Icon--promoted\"><\/span>      <span class=\"Tweet-badgeText\">Promocionado<\/span>   <\/div> <\/div>    <\/div> <\/div>   <\/body> <\/html> "
        }
    ],
    "request": {
        "params": {
            "preview_target": "TWITTER_TIMELINE",
            "tweet_id": "950692821840916480",
            "account_id": "18ce54fxokc"
        }
    }
}

The problem is that when using the web preview, we don’t see the card associated to the Tweet (see: https://twitter.com/Fisher%20InvestmentsES/status/950692821840916480).

Could you investigate?

Thanks,

Chris


#2

Hey @c_chauve

Can you confirm the API calls used to create this Tweet? For example, when looking at the Tweet preview in Ads Editor we see the same preview:


#3

Hi @imit8me,

We’re first creating the Card.

Input

{
    "url": "https:\/\/ads-api.twitter.com\/2\/accounts\/18ce54fxokc\/cards\/website",
    "method": "POST",
    "parameters": {
        "name": "HOF3_ESHS_HowDecide_ManChin_TwitterFEco_0118",
        "app_country_code": "GB",
        "website_title": "Descargue \"La gu\u00eda para seleccionar acciones\", si dispone de 350.000\u20ac.",
        "website_url": "https:\/\/ad.doubleclick.net\/ddm\/trackclk\/N709325.2365703DIGITALGROUP_ES\/B20252984.204378397;dc_trk_aid=405270565;dc_trk_cid=96894488;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=",
        "image_media_id": 951401723020660736
    }
}

Output

{
    "data": {
        "name": "HOF3_ESHS_HowDecide_ManChin_TwitterFEco_0118",
        "website_shortened_url": "https:\/\/t.co\/iKvBpQLzrz",
        "image_display_height": "100",
        "image": "https:\/\/pbs.twimg.com\/ad_img\/951401723020660736\/vRHfYZ_F?format=jpg&name=orig",
        "preview_url": "https:\/\/cards.twitter.com\/cards\/18ce54fxokc\/57zfl",
        "website_display_url": "www.fisherinvestments.eu",
        "id": "57zfl",
        "account_id": "18ce54fxokc",
        "website_dest_url": "https:\/\/www.fisherinvestments.eu\/es\/guia-para-seleccionar-acciones\/3m\/index.php?kc=DGGDGP3A283MHOF3&alleycode=3M&country=ES&PC=DGGDGP3A28&CC=HOF3",
        "created_at": "2018-01-11T10:33:46Z",
        "image_display_width": "191",
        "website_title": "Descargue \"La gu\u00eda para seleccionar acciones\", si dispone de 350.000\u20ac.",
        "card_uri": "card:\/\/951401742041800704",
        "website_url": "https:\/\/ad.doubleclick.net\/ddm\/trackclk\/N709325.2365703DIGITALGROUP_ES\/B20252984.204378397;dc_trk_aid=405270565;dc_trk_cid=96894488;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=",
        "updated_at": "2018-01-11T10:33:46Z",
        "deleted": false,
        "card_type": "WEBSITE"
    },
    "request": {
        "params": {
            "name": "HOF3_ESHS_HowDecide_ManChin_TwitterFEco_0118",
            "website_shortened_url": "https:\/\/t.co\/iKvBpQLzrz",
            "image_display_height": "100",
            "image": "https:\/\/pbs.twimg.com\/ad_img\/951401723020660736\/vRHfYZ_F?format=jpg&name=orig",
            "website_display_url": "www.fisherinvestments.eu",
            "account_id": "18ce54fxokc",
            "website_dest_url": "https:\/\/www.fisherinvestments.eu\/es\/guia-para-seleccionar-acciones\/3m\/index.php?kc=DGGDGP3A283MHOF3&alleycode=3M&country=ES&PC=DGGDGP3A28&CC=HOF3",
            "image_display_width": "191",
            "website_title": "Descargue \"La gu\u00eda para seleccionar acciones\", si dispone de 350.000\u20ac.",
            "website_url": "https:\/\/ad.doubleclick.net\/ddm\/trackclk\/N709325.2365703DIGITALGROUP_ES\/B20252984.204378397;dc_trk_aid=405270565;dc_trk_cid=96894488;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=",
            "card_type": "WEBSITE"
        }
    }
}

Then we’re creating the Tweet.

Input

{
    "url": "https:\/\/ads-api.twitter.com\/2\/accounts\/18ce54fxokc\/tweet\/",
    "method": "POST",
    "parameters": {
        "text": "\u00bfC\u00f3mo decide qu\u00e9 acciones debe vender?",
        "as_user_id": "3008331884",
        "card_uri": "card:\/\/951401742041800704"
    }
}

Output

    "data": {
        "created_at": "Thu Jan 11 10:33:46 +0000 2018",
        "id": 951401743425949696,
        "id_str": "951401743425949696",
        "text": "\u00bfC\u00f3mo decide qu\u00e9 acciones debe vender?",
        "truncated": false,
        "entities": {
            "hashtags": [],
            "symbols": [],
            "user_mentions": [],
            "urls": []
        },
        "source": "<a href=\"http:\/\/gus.adsopt.im\" rel=\"nofollow\">AdsOptim<\/a>",
        "in_reply_to_status_id": null,
        "in_reply_to_status_id_str": null,
        "in_reply_to_user_id": null,
        "in_reply_to_user_id_str": null,
        "in_reply_to_screen_name": null,
        "user": {
            "id": 3008331884,
            "id_str": "3008331884",
            "name": "Fisher InvestmentsES",
            "screen_name": "FisherInvestES",
            "location": "Espa\u00f1a",
            "url": "https:\/\/www.fisherinvestments.com\/es-es\/",
            "description": "Fisher Investments Espa\u00f1a es la denominaci\u00f3n comercial de Fisher Investments Europe Limited en Espa\u00f1a.",
            "protected": false,
            "followers_count": 779,
            "friends_count": 185,
            "listed_count": 4,
            "created_at": "Mon Feb 02 19:12:43 +0000 2015",
            "favourites_count": 22,
            "utc_offset": 3600,
            "time_zone": "Madrid",
            "geo_enabled": false,
            "verified": false,
            "statuses_count": 562,
            "lang": "en",
            "contributors_enabled": false,
            "is_translator": false,
            "is_translation_enabled": true,
            "profile_background_color": "C0DEED",
            "profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
            "profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
            "profile_background_tile": false,
            "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/566393580982255617\/nOJkVxgm_normal.png",
            "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/566393580982255617\/nOJkVxgm_normal.png",
            "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/3008331884\/1422904524",
            "profile_link_color": "1DA1F2",
            "profile_sidebar_border_color": "C0DEED",
            "profile_sidebar_fill_color": "DDEEF6",
            "profile_text_color": "333333",
            "profile_use_background_image": true,
            "has_extended_profile": false,
            "default_profile": true,
            "default_profile_image": false,
            "following": false,
            "follow_request_sent": false,
            "notifications": false,
            "translator_type": "none"
        },
        "geo": null,
        "coordinates": null,
        "place": null,
        "contributors": [
            3589550297
        ],
        "retweet_count": 0,
        "favorite_count": 0,
        "favorited": false,
        "retweeted": false,
        "possibly_sensitive": false,
        "scopes": {
            "followers": false
        },
        "card": {
            "name": "promo_website",
            "url": "card:\/\/951401742041800704",
            "card_type_url": "http:\/\/card-type-url-is-deprecated.invalid",
            "binding_values": {
                "website_shortened_url": {
                    "type": "STRING",
                    "string_value": "https:\/\/t.co\/iKvBpQLzrz"
                },
                "_forward_card_height_": {
                    "type": "STRING",
                    "string_value": "140"
                },
                "vanity_url": {
                    "type": "STRING",
                    "string_value": "www.fisherinvestments.eu"
                },
                "website_dest_url": {
                    "type": "STRING",
                    "string_value": "https:\/\/www.fisherinvestments.eu\/es\/guia-para-seleccionar-acciones\/3m\/index.php?kc=DGGDGP3A283MHOF3&alleycode=3M&country=ES&PC=DGGDGP3A28&CC=HOF3"
                },
                "website_url": {
                    "type": "STRING",
                    "string_value": "https:\/\/ad.doubleclick.net\/ddm\/trackclk\/N709325.2365703DIGITALGROUP_ES\/B20252984.204378397;dc_trk_aid=405270565;dc_trk_cid=96894488;dc_lat=;dc_rdid=;tag_for_child_directed_treatment="
                },
                "title": {
                    "type": "STRING",
                    "string_value": "Descargue \"La gu\u00eda para seleccionar acciones\", si dispone de 350.000\u20ac."
                },
                "promo_image_small": {
                    "type": "IMAGE",
                    "image_value": {
                        "url": "https:\/\/pbs.twimg.com\/ad_img\/951401723020660736\/vRHfYZ_F?format=jpg&name=orig",
                        "width": 800,
                        "height": 418,
                        "alt": null
                    }
                },
                "promo_image": {
                    "type": "IMAGE",
                    "image_value": {
                        "url": "https:\/\/pbs.twimg.com\/ad_img\/951401723020660736\/vRHfYZ_F?format=jpg&name=orig",
                        "width": 800,
                        "height": 418,
                        "alt": null
                    }
                },
                "promo_image_large": {
                    "type": "IMAGE",
                    "image_value": {
                        "url": "https:\/\/pbs.twimg.com\/ad_img\/951401723020660736\/vRHfYZ_F?format=jpg&name=orig",
                        "width": 800,
                        "height": 418,
                        "alt": null
                    }
                },
                "promo_image_x_large": {
                    "type": "IMAGE",
                    "image_value": {
                        "url": "https:\/\/pbs.twimg.com\/ad_img\/951401723020660736\/vRHfYZ_F?format=jpg&name=orig",
                        "width": 800,
                        "height": 418,
                        "alt": null
                    }
                },
                "promo_image_color": {
                    "type": "IMAGE_COLOR",
                    "image_color_value": {
                        "palette": [
                            {
                                "percentage": 67.99,
                                "rgb": {
                                    "red": 228,
                                    "green": 230,
                                    "blue": 227
                                }
                            },
                            {
                                "percentage": 16.94,
                                "rgb": {
                                    "red": 31,
                                    "green": 47,
                                    "blue": 73
                                }
                            },
                            {
                                "percentage": 4.54,
                                "rgb": {
                                    "red": 140,
                                    "green": 105,
                                    "blue": 86
                                }
                            },
                            {
                                "percentage": 3.93,
                                "rgb": {
                                    "red": 126,
                                    "green": 149,
                                    "blue": 187
                                }
                            },
                            {
                                "percentage": 1.52,
                                "rgb": {
                                    "red": 198,
                                    "green": 160,
                                    "blue": 129
                                }
                            }
                        ]
                    }
                },
                "card_url": {
                    "type": "STRING",
                    "string_value": "https:\/\/twitter.com",
                    "scribe_key": "card_url"
                }
            },
            "card_platform": {
                "platform": {
                    "device": {
                        "name": "AdsApi",
                        "version": "13"
                    },
                    "audience": {
                        "name": "production",
                        "bucket": null
                    }
                }
            }
        },
        "lang": "es"
    },
    "request": {
        "params": {
            "text": "\u00bfC\u00f3mo decide qu\u00e9 acciones debe vender?",
            "as_user_id": 3008331884,
            "card_uri": "card:\/\/951401742041800704",
            "account_id": "18ce54fxokc"
        }
    }

Thanks,
Chris


#4

This is very helpful, @c_chauve. Thanks for providing these details.

We’ll work on fixing this. We’ll provide an update once we know more around timing.


#5

Hey @juanshishido,

Thanks! Please let me know when you’ll manage to fix this since I need to communicate to our clients!

Best,
Chris


#6

Thanks, @c_chauve. We’re planning to have this resolved by the end of next week. We’ll provide another update once we have one.


#7

Thanks!


#8

@c_chauve: This issue has been resolved. I just tried for Tweet ID 951401743425949696 and the card rendered correctly. Thanks for bringing this to our attention!