Call to this api returns empty response https://ads-api.twitter.com/2/accounts/:account_id/cards/website


#1

Hi

We are getting empty response (sometimes) from this api call https://ads-api.twitter.com/2/accounts/:account_id/cards/website.

Please suggest, we are not getting any error, but getting only empty response. We are making a POST request.


#2

Hey @testadsindia ,

Can you please provide the exact request and response bodies of the request using twurl, along with the actual versus expected output?

Thanks!


#3

Hi,

Thanks for the quick response. Please find below:

Our Request:

POST https://ads-api.twitter.com/2/accounts/xxxxxxx/cards/website?image_media_id=xxxxx&name=xxxxxxxx website Card&website_title=test website card&website_url=http://www.xxxxx.com/details/xxxxxx.html

Expected response:
{
“data”:{
“name”:“xxxx website Card”,
“website_shortened_url”:“https://t.co/i4sYC7Mkio”,
“image_display_height”:“100”,
“website_cdn_amp_url”:“https://www.example.com.cdn.example.org/c/www.example.com/amp/test.html”,
“image”:“https://pbs.twimg.com/ad_img/xxxxxxxxxx/FoKUzMsd?format=jpg&name=orig”,
“website_amp_url”:“http://www.example.com/amp/test.html”,
“preview_url”:“https://cards.twitter.com/cards/xxxxxxxxxx/5ttaz”,
“website_display_url”:“www.example.com”,
“id”:“5ttaz”,
“account_id”:“xxxxxxxxxx”,
“website_dest_url”:“http://www.example.com/test.html”,
“created_at”:“2018-06-12T12:06:07Z”,
“image_display_width”:“191”,
“website_title”:“test website card”,
“card_uri”:“card://1006507940205826048”,
“website_url”:“http://www.example.com/details/test.html”,
“updated_at”:“2018-06-12T12:06:07Z”,
“deleted”:false,
“card_type”:“WEBSITE”
},
“request”:{
“params”:{
“name”:“xxxx website Card”,
“website_shortened_url”:“https://t.co/i4sYC7Mkio”,
“image_display_height”:“100”,
“website_cdn_amp_url”:“https://www.example.com.cdn.example.org/c/www.example.com/amp/test.html”,
“image”:“https://pbs.twimg.com/ad_img/xxxxxxxxxx/FoKUzMsd?format=jpg&name=orig”,
“website_amp_url”:“http://www.example.com/amp/test.html”,
“website_display_url”:“www.example.com”,
“account_id”:“xxxxxxxxxx”,
“image_media_id”:xxxxxxxxxx,
“website_dest_url”:“http://www.example.com/test.html”,
“image_display_width”:“191”,
“website_title”:“test website card”,
“website_url”:“http://www.example.com/details/test.html”,
“card_type”:“WEBSITE”
}
}
}

Actual response:
blank (empty response)


#4

@testadsindia: so you’re not getting an object with an empty data property?.. That’s what I thought after your initial post. You’re only getting an empty string?.. And what is the HTTP status code you’re receiving?


#5

Yes we are not getting an object with an empty data property.
We are only getting an empty string
Presently we are not tracking the HTTP status code, we will track this and get back to you. Thanks for the support.


#6

Would it be possible to get the exact, un-redacted request? If possible, we would like to be able to reproduce the issue precisely as it occurred.

Thanks!


#7

Hi Team, the issue is not occurring every time, except some times, we will track this and get back to you. The same request works fine after calling 2nd/3rd time. As its confidential it would not be possible to provide the exact request here. Thanks for the support.