Consumer Token Authentication

Overview

This documentation guide outlines the process of authenticating Docheart with Portbase consumer token. After successfully importing the consumer token into Docheart, users can access the Docheart APIs using the consumer token as an authentication method.

Using the Consumer Token

Now that we have seen how we create an API token, we will have a look at how to make use of it to authenticate an API request.

To authenticate API requests, you will take the consumer token and include it inside a custom HTTP header named X-api, as shown in the example request below:

  • const response = await fetch("https://api.docheart.ai/docheart/api/vault/list", {
        method: "GET",
        headers: {
            "X-Api": "<your-consumer-token>"
        } 
    })
    
  • curl -X GET https://api.docheart.ai/docheart/api/vault/list \
    -H "X-api: <your-consumer-token>"