Package com.veeva.vault.vapil.api.client
package com.veeva.vault.vapil.api.client
HTTPS Client for the Vault API
Authenticate with a Session ID
VaultClient vaultClient = VaultClient .newClientBuilder(VaultClient.AuthenticationType.SESSION_ID) .withVaultClientId("verteobiotech-vault-demo") //required .withVaultDNS("verteobiotech.veevavault.com") //required .withVaultSessionId("123456ABCDEFG") //required .withValidation(true) //default = true .withApiErrorLogging(true) //default = true .withHttpTimeout(60) //default = 60 .build(); System.out.println("Response Status: " + vaultClient.getAuthenticationResponse().getResponseStatus()); System.out.println("SessionId: " + vaultClient.getSessionId()); if (!vaultClient.hasSessionId()) { System.out.println("Login failed"); }
Authenticate with username and password
VaultClient vaultClient = VaultClient .newClientBuilder(VaultClient.AuthenticationType.BASIC) .withVaultClientId("verteobiotech-vault-demo") //required .withVaultDNS("verteobiotech.veevavault.com") //required .withVaultUsername("vault.user@verteobiotech.com") //required .withVaultPassword("Use$tr0ngPasswords") //required .withValidation(true) //default = true .withApiErrorLogging(true) //default = true .withHttpTimeout(60) //default = 60 .build(); System.out.println("Response Status: " + vaultClient.getAuthenticationResponse().getResponseStatus()); System.out.println("SessionId: " + vaultClient.getSessionId()); if (!vaultClient.hasSessionId()) { System.out.println("Login failed"); }
Authenticate with a JSON settings file
Example settings files can be found hereFile settingsFile = new File("settings.json"); VaultClient vaultClient = VaultClient .newClientBuilderFromSettings(settingsFile) .build(); System.out.println("responseStatus = " + vaultClient.getAuthenticationResponse().getResponseStatus()); System.out.println("SessionId = " + vaultClient.getSessionId()); if (!vaultClient.hasSessionId()) { System.out.println("Login failed"); }
-
ClassDescriptionBase class for all Vault integration calls where a Vault session is established via:
1.Type of Authentication with the Vault API