VaultApiClient
Provides functions to use Vault API from client code.
Properties
Section link for Propertiesfetch: (
input,init?) =>Promise<Response>
Makes authorized requests to Vault API and prepends the /api prefix to the path.
This is a wrapped version of JavaScript's fetch function.
Parameters
Section link for Parametersstring
The URL string to make a request to
RequestInit
A RequestInit
Returns
Section link for ReturnsPromise<Response>
A Promise
- https://developer.veevavault.com/api/
- https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
Remarks
Section link for RemarksOnly accepts strings as input. Does not accept URL or Request objects.
Naively prepends /api to the provided URL. For example, calling this with "http://example.com"
would make a request to "/api/http://example.com".
Example
Section link for Exampleimport { vaultApiClient } from '@veeva/vault'
const response = await vaultApiClient.fetch(
'/v25.1/objects/documents/301',
{
headers: {
Accept: 'application/json',
},
}
);
const json = response.json();