public WebhookResponseData createWebHook ( Webhook webhook ) throws UnauthorizedException , GeneralException { if ( webhook . getTitle ( ) == null ) { throw new IllegalArgumentException ( "Title of webhook must be specified." ) ; } if ( webhook . getUrl ( ) == null ) { throw new IllegalArgumentException ( "URL of webhook must be specified." ) ; } String url = String . format ( "%s%s" , VOICE_CALLS_BASE_URL , WEBHOOKS ) ; return messageBirdService . sendPayLoad ( url , webhook , WebhookResponseData . class ) ; }
Function to create web hook