Pretty cool, I just tried it and it worked. I didn't like how I had to send two requests with the same message, one before and one after opting in. Ideally after opting in I would have received the initial message. Otherwise any application would have to use polling.
For the code snippets you could use httpsnippet[1] or apiembed[2] to support some more languages.