I wonder what could be my error… Can you leave me some pointers on where I should change my logic.
When I use ‘https://api.twitter.com/1.1/statuses/update_with_media.json’ - (depricated) to update my status with image, it was successfully posting, however like you pin point, image and cards won’t show at the same time.
So when I use ‘https://api.twitter.com/1.1/statuses/update.json’, I can still post successfully, the card is showing. however the image won’t attach to that tweet (done without card’s url). I use ‘https://upload.twitter.com/1.1/media/upload.json’ to upload the media.
the actual media return was constructed like this:
{
“expires_after_secs” = 86400;
image = {
h = 520;
“image_type” = “image/jpeg”;
w = 329;
};
“media_id” = 725313562713808896;
“media_id_string” = 725313562713808896;
size = 17503;
}
So, I tried this parameters.
let params = [“status”: message, “media_ids”: 725313562713808896 ]
and
let params = [“status”: message, “media_ids”: [725313562713808896] ] // expecting it to be an array of ‘media_ids’
Result: It was successful on both parameters but the image won’t show and just the tweet (card url is working here). I used the same image I used in ‘https://api.twitter.com/1.1/statuses/update_with_media.json’
Sequence: I uploaded first the media to ‘https://upload.twitter.com/1.1/media/upload.json’ to get the media_id then proceed to the ‘https://api.twitter.com/1.1/statuses/update.json’ with the above parameters