public BoxComment . Info reply ( String message ) { JsonObject itemJSON = new JsonObject ( ) ; itemJSON . add ( "type" , "comment" ) ; itemJSON . add ( "id" , this . getID ( ) ) ; JsonObject requestJSON = new JsonObject ( ) ; requestJSON . add ( "item" , itemJSON ) ; if ( BoxComment . messageContainsMention ( message ) ) { requestJSON . add ( "tagged_message" , message ) ; } else { requestJSON . add ( "message" , message ) ; } URL url = ADD_COMMENT_URL_TEMPLATE . build ( this . getAPI ( ) . getBaseURL ( ) ) ; BoxJSONRequest request = new BoxJSONRequest ( this . getAPI ( ) , url , "POST" ) ; request . setBody ( requestJSON . toString ( ) ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject responseJSON = JsonObject . readFrom ( response . getJSON ( ) ) ; BoxComment addedComment = new BoxComment ( this . getAPI ( ) , responseJSON . get ( "id" ) . asString ( ) ) ; return addedComment . new Info ( responseJSON ) ; }
Replies to this comment with another message .