public void createEvent ( Map < String , Object > eventParams ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { cleanError ( ) ; prepareToken ( ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . CREATE_EVENT_URL ) ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; String body = JSONUtils . buildJSON ( eventParams ) ; bearerRequest . setBody ( body ) ; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . POST , OneloginOAuthJSONResourceResponse . class ) ; if ( oAuthResponse . getResponseCode ( ) != 200 || ! oAuthResponse . getType ( ) . equals ( "success" ) ) { error = oAuthResponse . getError ( ) ; errorDescription = oAuthResponse . getErrorDescription ( ) ; errorAttribute = oAuthResponse . getErrorAttribute ( ) ; } }
Create an event in the OneLogin event log .