Hello ,

I used the Old endpoint

  • [Website Cards
  • [Video Website Cards

and up to 3 weeks ago I was able to got the following values from the endpoints
but now as these been officially deprecated

I have to use the https://ads-api.twitter.com/11/accounts/(account_id)/cards/all
but this does have the values which I used to have
media_url" , “website_url” and poster_media_url"
my question how I can get this value from the new version and also is the link above for video web card as will or there is another endpoint ?

Any update as I can not see a link between the media_key in cards and media library as teh cards does not have the media_key how can I solve this issue ?

Hello,

Thanks for reaching out. Could you send the API request/response for us to troubleshoot the issue further? Please also include your accountID. This information isn’t considered sensitive and cannot be used by unauthorized users in any way.

Hello ,

In the old version I was using the following endspoint call where apiVersoin is 9 or 10
https://ads-api.twitter.com/“+apiVersoin+ “/accounts/”+accountId+”/tweets?tweet_type=PUBLISHED&timeline_type=ALL&count=999&tweet_mode=extended").asStream()
and I was getting the accountid from twitterAdsInstance.getTwitterAdsClient().get(“https://ads-api.twitter.com/“+apiVersoin+”/accounts”).asStream());
and timesline response from
https://ads-api.twitter.com/“+apiVersoin+ “/accounts/”+accountId+”/tweets?tweet_type=PUBLISHED&timeline_type=ALL&count=999&tweet_mode=extended

and the website cards from
https://ads-api.twitter.com/“+apiVersoin+ “/accounts/”+accountId+”/cards/website?sort_by=created_at-desc

and website videos from

https://ads-api.twitter.com/“+apiVersoin+ “/accounts/”+accountId+”/cards/video_website?sort_by=created_at-desc

and was working fine and was getting the right values

Now I am using

The same for accounts and Twieet line

but for the cards and media library I am using the following see this is the same post

Request :-
https://ads-api.twitter.com/“+apiVersoin+ “/accounts/”+accountId+”/cards?include_legacy_cards=true&sort_by=created_at-desc

Response:-

{“coordinates”:null,“retweeted”:false,“name”:“Roll Over Old 401k April 2022”,“conversation_settings”:“EVERYONE”,“source”:“<a href="https://twitter.com" rel="nofollow">Twitter for Advertisers”,“entities”:{“hashtags”:,“symbols”:,“user_mentions”:,“urls”:},“display_text_range”:[0,172],“favorite_count”:21,“in_reply_to_status_id_str”:null,“geo”:null,"id_str":“1516812858138443786”,“in_reply_to_user_id”:null,“truncated”:false,“retweet_count”:4,“scheduled_status”:null,“id”:1516812858138443786,“in_reply_to_status_id”:null,“nullcast”:false,“created_at”:“Wed Apr 20 16:15:41 +0000 2022”,“place”:null,“scheduled_at”:null,“tweet_type”:“PUBLISHED”,“favorited”:false,“card_uri":"card://1516812856938926080”,“full_text”:“Job hopping: it’s what we’ve always done to some degree, but for millennials, it’s occurring more and more. So what should you do with a 401(k) held at a previous employer?”,“lang”:“en”,“contributors”:null,“in_reply_to_screen_name”:null,“in_reply_to_user_id_str”:null,“user”:{“utc_offset”:null,“name”:“comapny”,“friends_count”:47,“screen_name”:“company”,“location”:“Omaha, Nebraska, USA”,“protected”:false,“url”:“https://www.company.com/",“profile_image_url”:“http://pbs.twimg.com/profile_images/1189934351108186112/3iYyfL-j_normal.png”,“profile_background_color”:“183028”,“profile_use_background_image”:true,“is_translator”:false,“geo_enabled”:true,“description”:"Important Disclosures: Social Media Disclosures | TD Ameritrade Official Twitter page of TD Ameritrade. Tweet Client Service: Mon – Sun 8 am – 8 pm ET. 24/7 Help 1-800-669-3900.”,“profile_link_color”:“183028”,“id_str”:“16816021”,“listed_count”:1333,“default_profile_image”:false,“followers_count”:173817,“profile_image_url_https”:“https://pbs.twimg.com/profile_images/1189934351108186112/3iYyfL-j_normal.png",“profile_sidebar_border_color”:“FFFFFF”,“profile_background_image_url”:“http://abs.twimg.com/images/themes/theme1/bg.png”,“favourites_count”:80,“following”:null,“default_profile”:false,“withheld_in_countries”:[],“id”:16816021,“profile_background_tile”:false,“contributors_enabled”:false,“follow_request_sent”:null,“created_at”:"Thu Oct 16 23:14:24 +0000 2008”,“profile_sidebar_fill_color”:“F4F4F4”,“translator_type”:“none”,“lang”:null,“profile_text_color”:“333333”,“notifications”:null,“verified”:true,“time_zone”:null,“profile_banner_url”:“https://pbs.twimg.com/profile_banners/16816021/1572537433",“statuses_count”:77361,“profile_background_image_url_https”:“https://abs.twimg.com/images/themes/theme1/bg.png”,“is_translation_enabled”:false},“tweet_id”:"1516812858138443786”}

Request : -

https://ads-api.twitter.com/“+apiVersoin+ “/accounts/”+accountId+”/media_library?sort_by=created_at-desc

Response :-
{“tweeted”:false,“name”:“trontrhero_tt.jpg”,“file_name”:“trontrhero_tt.jpg”,“media_url”:“https://pbs.twimg.com/media/FQzIUgHXMAMGhPJ.jpg",“original_width”:1400,“original_height”:863,“**media_key”:“*3_1516807429060767747***”,“created_at”:“2022-04-20T15:54:06Z”,“media_status”:“TRANSCODE_COMPLETED”,“media_type”:“IMAGE”,“updated_at”:“2022-04-20T15:54:09Z”,"deleted”:false}

I was Hoping to find a link between the 2 responses and I was thinking the media_key could be link to the card_uri or id_str but nothing related

Thank you,
Ihab

Hello,

Thanks for the details.

You can actually specify the card_uris param in the request for the GET accounts/:account_id/cards endpoint. In the response, there should be a media_key param for you to reference to.

Currently, this is your request:

https://ads-api.twitter.com/"+apiVersoin+ “/accounts/”+accountId+"/cards?include_legacy_cards=true&sort_by=created_at-desc

Could you try doing this:

https://ads-api.twitter.com/"+apiVersoin+ “/accounts/”+accountId+"/cards?include_legacy_cards=true&sort_by=created_at-desc&card_uri=<insert card_uri value>

Also, would be great if you can share with me your accountID as well as a sample card_uri so that I can try to reproduce on my end to see if I am able to get the media_key param in the response.

My issue how to Get the media_url , web_site_url and poster_media is not with the card

so i can have it in an email
here is an example of how I used to get it but with version 11 I am not able to get that any more except the full_text and date

We use real feedback from traders like you, to make our best-in-class platforms even better.
(media_url)

https://www.company.com/tools-and-platforms/company.html?cid=SMTwitter:Weusereal:2022&adch=soc (websit_url)

2022-03-29T15:14:25Z

Hello,

From the cards endpoint, the response should have a media key which is ‘linked’ to the media_key in the media_library endpoint.

Example (I am using the twurl command, but it should work the same as your request):

Request

twurl -H ads-api.twitter.com "/11/accounts/<account_id>/cards" | jq . 

Response

Screenshot 2022-05-12 at 1.32.10 PM

As you can see, it return the media_keys and if I were to call the media_library endpoint, this media_key (As seen above), is being reflected in the response as well

Request

twurl -H ads-api.twitter.com "/11/accounts/<account_id>/media_library" | jq .

Response

The return for the components is not right it has a empty entry so it deal with it as a new rntry see the one with bulk

components" : [ {
“media_key” : “3_1524046680550739969”,
“media_metadata” : {
“3_1524046680550739969” : {
“type” : “IMAGE”,
“url” : “https://pbs.twimg.com/media/FSaAYZdaaAEZKKJ.jpg”,
“width” : 800,
“height” : 418
}
},
“type” : “MEDIA”
}, {
** “title**” : “Value Stocktments: Building a Durable Portfolio”,
“destination” : {
“url” : “https://tickertape.company.com/investing/compue-stocks-for-durable-portfolio-17177”,
“type” : “WEBSITE”
},
“type” : “DETAILS”
} ],
“id” : “1524046834934730752”,
“created_at” : “2022-05-10T15:20:55Z”,
“card_uri” : “card://15240468s34730752”,
“updated_at” : “2022-05-10T15:20:55Z”,
“deleted” : false,
“card_type” : “IMAGE_WEBSITE”

Hello,

Could you elaborate on what you meant by “The return for the components is not right it has a empty entry”?

The above information you sent is from the media_library endpoint which returns a media_key 3_1524046680550739969. Can you share what you got for the cards endpoint?

This is from https://ads-api.twitter.com/11/accounts/(account_id)/cards/all

Thank you for your looking into this issue I was able to solve the issue card legacy has most the info I needed plus media Library