People come to Twitter to connect and interact with each other, with their favorite teams, celebrities, brands, or musicians, with world leaders, with their communities, and more. Whether it’s creating engaging content of your own, or building solutions that allow others to engage, developers play a critical role in how people connect and interact on Twitter.

Today, we’re excited to share our early thinking for how we’re designing new endpoints for the Engage use case; specifically the endpoints that will allow you to create Tweets, like Tweets, and Retweet Tweets from the v2 Twitter API. These endpoints allow you to create experiences or solutions so that users can be better equipped to engage in the public conversation.

As we have committed to in the past, we are continuing to build in the open, and collect feedback from our developer community along the way. Below is a brief overview of our vision for what the endpoints that allow you to create, like, and Retweet Tweets might look like in the v2 Twitter API. Many of the proposed features are based on feedback we have already received from our developer community, but if you have additional ideas on the future state of these endpoints, we’d love to hear from you!

Tweeting

Twitter wouldn’t be Twitter without the ability to create a Tweet. In the new Twitter API, we will keep the functionality of the v1.1 endpoints, and we’re hoping to add the ability to create polls and tag people in uploaded images via the v2 endpoints. Additionally, based on requests from our community, we’re hoping to add the ability for developers to schedule a Tweet to be posted at a later date and time. Finally, as we have done in the Twitter App, we’re exploring adding support for Tweet reply settings which allow people more control over who responds to their Tweets.

Tweet with polls Tweet with media
Endpoint* POST /2/tweets POST /2/tweets
Request body {
"attachments": {
"polls": [
{
"label": "😀"
},
{
"label": "🤨"
},
{
"label": "😒"
}
]
},
"text": "What do you think about the new Tweet endpoint?"
}
{
"text":"just setting up my camera",
"media_ids":1234567890,
"additional_media_info": {
"1234567890": {
"thumbnail_id": 987654321,
"title":"Test Title",
"description":"Describe",
"embeddable": true,
"call_to_actions":{
"watch_now":{
"url": "https://www.twitter.com"
}
}
}
}
`}
Response body { “id”: “927191723998888” } { “id”: “927191723999999” }

*Sample code is provided here and below to demonstrate potential request/response body (it is not inclusive of every v1.1 endpoint we intend to replace)

Likes

Liking Tweets is a fundamental way people interact with each other and engage with content on Twitter. In addition to maintaining core v1.1 functionality on the new v2 likes endpoints, we hope to add net new functionality that allows developers to retrieve a list of people that have liked a specific Tweet. As an example, this could provide insight into which accounts engaged with a Tweet, in case the author wants to tailor content to that audience in the future Additionally, as is true with other user-related endpoints on the v2 Twitter API, developers would have the flexibility to request the full user object, or only the user fields they care about.

Like / unlike Get list of people that liked a Tweet
Endpoint PUT /2/tweets/:id/liked GET /2/tweets/:id/liked?user.fields=description
Request body { “liked”: true }
Response body { “liked”: true } {
"data": [
{
"description": "#bitcoin",
"id": "12",
"name": "jack",
"username": "jack"
},
{
"description": "The voice of the #TwitterDev team and your official source for updates, news, and events, related to the #TwitterAPI.",
"id": "2244994945",
"name": "Twitter Dev",
"username": "TwitterDev"
}]
`}

Retweeting

In the new Twitter API, Retweets and Quote Tweets will maintain the same functionality as the v1.1 endpoints. If you have feedback or new ideas for these endpoints, please feel free to fill out the survey linked at the end of this post!

Retweet Un-Retweet
Endpoint POST /2/tweets/:id/retweeted DELETE /2/tweets/:id/retweeted
Request body { “id”: “id_of_retweet” }
Response body { “id”: “id_of_retweet”,
“retweeted”: true }
`{ “retweeted”: “false” }

It’s important to emphasize that we are still in the definition phase of designing these new endpoints. We will continue listening to feedback throughout our design process, however, we may not be able to include all of the above functionality in the final solution. For updates on the progress of these new endpoints follow along on our public roadmap or @TwitterDev for updates on all things Twitter API. Lastly, it’s important to note that these endpoints represent a starting place for us, and by no means are the extent of what we have planned for the Engage use case in the v2 Twitter API.

If you have additional suggestions or ideas on the future of creating, liking, or Retweeting Tweets via the API, please fill out this short survey. We can’t wait to hear from you!

8 Likes