get JSON from messages