If you want to get all your messages (maybe to display on an internal web page) via ajax you can do the following (using jquery)
Note that the path is
/messages.js instead of
/messages.json also the last argument in
If you put this on a public page everyone can view your messages and will be able to delete them as the ‘api_token’ is a private token, so put this only on non public pages.