public static Message create ( final BandwidthClient client , final Map < String , Object > params ) throws Exception { final String messageUri = client . getUserResourceUri ( BandwidthConstants . MESSAGES_URI_PATH ) ; final RestResponse response = client . post ( messageUri , params ) ; final String messageId = response . getLocation ( ) . substring ( client . getPath ( messageUri ) . length ( ) + 1 ) ; return get ( client , messageId ) ; }
Factory method to send a message from a params object given a client instance