How to Add a description field in 'statuses/update' api


#1

Hi,

I am using the following api to post information programmatically via an external library(https://twitteroauth.com/).

https://dev.twitter.com/rest/reference/post/statuses/update

I want to include a description information along with title and image. I have successfully posted both title and image(using status and media_ids attributes). But there is no corresponding attribute to post additional information like description.

If anyone can help on this it will be helpful.


#2

You can use the POST media/metadata/create endpoint to do that.


#3

I want to add a description like that highlighted in the image. Is it possible to achive this using the following API?

https://dev.twitter.com/rest/reference/post/media/metadata/create


#4

No. What you are seeing there is a Twitter card. You’ll need to add metadata to a web page and then share that link on Twitter to have the card show up. This is not possible using the media APIs.


#5

Thanks for your reply. I am basically using the following api to post to twitter on behalf of user

https://dev.twitter.com/rest/reference/post/statuses/update

Is there any way to include the information such as description except the ‘status’ parameter? Is there any other API to achieve this?


#6

No. What you’d do in that case, is include a web link inside the status parameter. If there is card markup at the URL, then the Tweet will render the image and description from the target website. Note that you cannot also attach an image to the Tweet if you want a card to render, as the image will take priority.


#7

What I am doing right now are the following

1] First uploading the image using ‘‘media/upload’’ api.
2] Then using '‘statuses/update’ to post twitter using the media ids returned in the previous api call.

Do I need to change the process ?


#8

Yes, if you want your Tweet to look like the one you posted in the image, you need to use Twitter Cards and post the URL, instead of attaching an image. If you don’t want the “description” (aka the card summary description) you can continue to do what you are doing now.