Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.19 KB

api-requests.md

File metadata and controls

37 lines (29 loc) · 1.19 KB
description icon
Learn how to make an API request
magnifying-glass-chart

API Requests

Make an API Request

You will need an auth_token from a user (see Authentication) to make requests to Verida endpoints.

API requests must include the auth_tokenin the Authorization header as a Bearer token.

const API_ENDPOINT = "https://api.verida.ai/api/rest/v1/auth";
// Obtain token from localstorage (or your own database)
const authToken = localStorage.getItem("veridaAuthToken") || "";

// Example: search/universal endpoint
$.get({
    url: `${API_ENDPOINT}/search/universal?keywords=meeting+agenda`,
    headers: {
        "Authorization": `Bearer ${authToken}`,
        "Content-Type": "application/json"
    },
    success: (response) => {
        console.log(response);
        // Handle the response data
    }
});

Important: Ensure you store and handle the auth_token securely. Unauthorized access to this token could compromise your application and user data.

{% hint style="info" %} See the Broken link or API Reference to learn more about all the available endpoints {% endhint %}