Vantage REST API

Become familiar with our API and select the approach that best fits your needs

Welcome to the API Usage section of our documentation!

Here, you will find various interfaces for using the Vantage API, which is divided into Management and Search sections. Each section is further divided into more detailed parts for managing collections, accounts, API keys, and various search methods.

Each code snippet will demonstrate the use of each Vantage functionality through the Vantage Python SDK and Vantage CLI libraries.

Below you find how you can configure your Vantage client using different approaches, which you'll find handy for both Management and Search API pages.

Happy discovering!

Vantage Client Configuration

Within the Vantage, you have the flexibility to initialize the client using three authentication methods:

  • using Vantage API key (recommended)
  • using client credentials
  • using a JWT token

The following code blocks will demonstrate all three methods.

It's required to specify your Account ID during initialization process and optionally change API and Auth hosts.

Method 1: Using Vantage API Key (recommended)

The recommended method for initializing the Vantage client is by using a Vantage API key. This key can be obtained either through the Vantage Console UI or programmatically via the Management API. Please provide the key, together with your ACCOUNT_ID, in the code block below.

Developer note: Additionally, you have the option to set API_HOST if you wish to target a different environment.

from vantage_sdk import VantageClient

vantage_instance = VantageClient.using_vantage_api_key(
    vantage_api_key=VANTAGE_API_KEY,
    account_id=ACCOUNT_ID,
    api_host=API_HOST,
)
import { VantageClientConfiguration, VantageClient } from "@vantage-sdk";

const configuration: VantageClientConfiguration = {
    vantageApiKey: vantageApiKey,
    accountId: accountId, 
    apiHost: apiHost
}
let client = new VantageClient(configuration)
import com.vantagediscovery.sdk.VantageClient;

public static void main(String[] args) {
    final VantageClient client = VantageClient.usingVantageApiKey()
        .withAccountId(ACCOUNT_ID)
        .withVantageApiKey(VANTAGE_API_KEY)
        .build();
}
vantage --account-id ACCOUNT_ID --vantage-api-key API_KEY ...

Method 2: Using Client Credentials

In this approach, we're using client credentials as the authentication method specified by VANTAGE_CLIENT ID and VANTAGE_CLIENT_SECRET. Please provide them, along with your ACCOUNT_ID, in the code block below.

Developer note: Additionally, you have the option to set API_HOST if you wish to target a different environment.

from vantage_sdk import VantageClient

vantage_instance = VantageClient.using_client_credentials(
    vantage_client_id=VANTAGE_CLIENT_ID,
    vantage_client_secret=VANTAGE_CLIENT_SECRET,
    account_id=ACCOUNT_ID,
    api_host=API_HOST,
)
import com.vantagediscovery.sdk.VantageClient;

public static void main(String[] args) {
    final VantageClient client = VantageClient.usingClientCredentials()
        .withAccountId(ACCOUNT_ID)
        .withClientId(CLIENT_ID)
        .withClientSecret(CLIENT_SECRET)
        .build();
}
vantage --account-id ACCOUNT_ID --client-id CLIENT_ID --client-secret CLIENT_SECRET ...

Method 3: Using JWT Token

In this approach, authentication is handled using a JWT token specified by VANTAGE_JWT_TOKEN. Please provide this token, along with your ACCOUNT_ID, in the code block below.

Developer note: Additionally, you have the option to set API_HOST if you wish to target a different environment.

from vantage_sdk import VantageClient

vantage_instance = VantageClient.using_jwt_token(
    vantage_jwt_token=VANTAGE_JWT_TOKEN,
    account_id=ACCOUNT_ID,
    api_host=API_HOST,
)
import com.vantagediscovery.sdk.VantageClient;

public static void main(String[] args) {
    final VantageClient client = VantageClient.usingJwtToken()
        .withAccountId(ACCOUNT_ID)
        .withJwtToken(JWT_TOKEN)
        .build();
}
vantage --account-id ACCOUNT_ID --jwt-token JWT_TOKEN ...