I’m using an auto poster to post news stories to my Twitter account. I need to be able to return the ID of the tweet just posted so that I can store it in the database for future use e.g. to delete the tweet if the news story is deleted.

I came across other people simply getting the last tweet ID, but obviously there’s a (slim) chance that the last one is not the posted tweet.

Is there a way for me to get the exact tweet that was posted?

The response to statuses/update contains the ID, but if you’re not controlling that bit it might be hard to get to.

Otherwise, just occasionally reading from statuses/user_timeline for your account or using user streams are two ways to receive the most recent tweets created by an account, from which you can build your index.

I’m pretty new to API’s etc. I don’t know how to read the response.