Getting your ex boyfriend back through a text message first depends on which person ended the relationship. Whether you broke up with him or he broke up with you will dictate how to craft the text message. In either situation, allow a reasonable amount of time to pass after the break up, as both he and you need space to reflect on what went wrong.
Text something that shows thoughtfulness about him, but don't try to write a book either. Keep it concise and to the point. For example, you could say, "I was watching your college team play on television this past weekend, and it reminded me of all those funny experiences you told me about school." A text message like this attempts to open the lines of communication.
Choose your words carefully. Texting something general, such as, "what's up, what's going on" isn't appropriate because it indicates that you're checking up on your ex boyfriend and that you're needy. Make sure you have a purpose behind your text.
Apologise for what you did wrong, if you said or did something that caused the break up. The text apology is the follow up text message after your ex boyfriend sends a reply. You don't have much room for fluff, so just be forthright about things.
Ask if you can meet over coffee or a drink and discuss patching things up.
Write a message that states that you were wrong in ending things. The best strategy is to be honest about the situation because you have to win his heart back first, and that's difficult to do in a text message.
Leave him alone for a while if he doesn't return the text message right away. He may need some time to think about your text, so do not pester him with follow up messages.
If you receive a warm reply, send a text asking if you can meet to discuss patching things up.
Text messaging isn't the ideal mechanism to get your ex boyfriend back because it's challenging to sound sincere through written words.
Do not text while under the influence of alcohol, as you might regret some of the words that you used. Do not follow up with another text message to engage discussion if he does not reply in a favourable way.