code: public static Event createEventFromString(final String in) throws AppPlatformException {
  
          JSONObject jsonObj = null;
          try {
              jsonObj = (JSONObject) new JSONParser().parse(in);
          } catch (final org.json.simple.parser.ParseException e) {
              throw new AppPlatformException(e);
          }
  
          final EventType eventType = EventType.getEnum((String) jsonObj
                  .get("eventType"));
  
          Event event = null;
          switch (eventType) {
              case INCOMINGCALL:
                  event = new IncomingCallEvent(jsonObj);
                  break;
  
              case ANSWER:
                  event = new AnswerEvent(jsonObj);
                  break;
  
              case SPEAK:
                  event = new SpeakEvent(jsonObj);
                  break;
  
              case PLAYBACK:
                  event = new PlaybackEvent(jsonObj);
                  break;
  
              case GATHER:
                  event = new GatherEvent(jsonObj);
                  break;
  
              case HANGUP:
                  event = new HangupEvent(jsonObj);
                  break;
  
              case DTMF:
                  event = new DtmfEvent(jsonObj);
                  break;
  
              case REJECT:
                  event = new RejectEvent(jsonObj);
                  break;
  
              case RECORDING:
                  event = new RecordingEvent(jsonObj);
                  break;
  
              case TRANSCRIPTION:
                  event = new TranscriptionEvent(jsonObj);
                  break;
  
              case SMS:
                  event = new SmsEvent(jsonObj);
                  break;
  
              case TIMEOUT:
                  event = new TimeoutEvent(jsonObj);
                  break;
  
              case CONFERENCE:
                  event = new ConferenceEvent(jsonObj);
                  break;
  
              case CONFERENCE_MEMBER:
                  event = new ConferenceMemberEvent(jsonObj);
                  break;
  
              case CONFERENCE_PLAYBACK:
                  event = new ConferencePlaybackEvent(jsonObj);
                  break;
  
              case CONFERENCE_SPEAK:
                  event = new ConferenceSpeakEvent(jsonObj);
                  break;
  
              default:
                  event = new EventBase(jsonObj);
          }
  
          return event;
      }
docs: This method creates an event from a json string. Given an event from the App Plotform
  API, the whole body can be passed in and the appropriate Event subclass will be returned.
  @param in the json representation
  @return the event
  @throws AppPlatformException API Exception