public ServiceCall < SessionResponse > createSession ( CreateSessionOptions createSessionOptions ) { Validator . notNull ( createSessionOptions , "createSessionOptions cannot be null" ) ; String [ ] pathSegments = { "v2/assistants" , "sessions" } ; String [ ] pathParameters = { createSessionOptions . assistantId ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "conversation" , "v2" , "createSession" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( SessionResponse . class ) ) ; }
Create a session .