I added a tweet-button
as detailed here: twitter button
What I'd like is once the user clicks this twitter button I retrive the post id.
Currently after a tweet it goes here: twitter success redirect
How do I set the tweet to return back to the server and give me the tweet id.
You can't do it with just a twitter button. You will have to integrate with their API in order to retrieve the post ID. You will have to write your own window for users to enter their message and you submit that through their API after which it will give you a post ID. This is the endpoint you most likely need statuses/update