Skip to content

HTTP Callout provides a Vault Java SDK service, HTTPService, to construct request and response objects and send requests. Requests are sent synchronously and send calls are blocking, meaning requests wait for a response until they timeout. HTTP requests happen outside of an SDK code transaction, so requests do not rollback.

HTTP request bodies are available in JSON or CSV format, through the use of JsonService and CsvService. Learn more in the Javadocs.

When creating HTTP Callouts, keep the following best practices in mind:

  • If you need to make HTTP callouts in bulk, do not put HTTP request calls in a loop.
  • Avoid callouts that could result in an infinite loop.
  • Use an asynchronous processor so the user is not waiting for a response.
  • Use a short response timeout. If a long response is expected, make the callout from a Message.
  • If you are unsure whether a local request will succeed for the provided user type, call isLocalHttpRequestAllowed(RequestContextUserType)before calling newLocalHttpRequest(RequestContextUserType).

To make an HTTP callout, you must first set up a Connection in Vault Admin. Connections can be set up for the local Vault, with another Vault, or with an external application. Local and Vault to Vault connection types can be set up with an Authorized Connection User to control what data access is allowed. External connection types may also be set up to make requests with one of the following Connection Authorization (connection_authorization__sys) types:

  • Basic Auth (basic_auth__sys): The User Name (username__sys) and Password (password__sys) of the external system
  • Client Credential (client_credentials__sys): The Client ID (client_id__sys) and Client Secret (client_secret__sys) of the external system

Learn more about Creating & Managing Connections in Vault Help.