Vampelium API Documentation

Public API reference for Vampelium System Service

API Overview

The Vampelium System Service provides two main API endpoints for authentication and database operations. These APIs can be integrated into other platforms to extend the functionality of Vampelium.

Base URL

TEST_APP_a1b2c3d4- e5f6-7890-1234-567890abcdef

Authentication

Base URL: /system/api/v1/vampauth

The authentication API handles user authentication and session management.

Database

Base URL: /system/api/v1/vampdatabase

The database API provides access to the Vampelium database for storing and retrieving data.

Authentication API

Endpoints

POST /system/api/v1/vampauth

Authenticate a user and get a session token

Request Body:
{
  "username": "string",
  "password": "string"
}
Response:
{
  "token": "string"
}

GET /system/api/v1/vampauth

Validate a session token

Headers:
Authorization: Bearer <token>
Response:
{
  "valid": boolean
}

DELETE /system/api/v1/vampauth

Log out and invalidate a session token

Headers:
Authorization: Bearer <token>
Response:
{
  "success": boolean
}
Database API

Endpoints

GET /system/api/v1/vampdatabase

Get collections or data from a collection

Headers:
Authorization: Bearer <token>
Query Parameters:
collection: string (optional)
[key]: string (optional, for filtering)
Response:
// Without collection parameter
{
  "collections": string[],
  "stats": {
    "collections": number,
    "records": number,
    "collectionStats": {
      [collection: string]: number
    }
  }
}

// With collection parameter
{
  "collection": string,
  "data": any[]
}

POST /system/api/v1/vampdatabase

Create a collection or insert data into a collection

Headers:
Authorization: Bearer <token>
Content-Type: application/json
Request Body:
{
  "collection": string,
  "data": any (optional)
}
Response:
{
  "success": boolean,
  "id": string (if data was provided),
  "message": string
}

PUT /system/api/v1/vampdatabase

Update data in a collection

Headers:
Authorization: Bearer <token>
Content-Type: application/json
Request Body:
{
  "collection": string,
  "query": object,
  "update": object
}
Response:
{
  "success": boolean,
  "updatedCount": number,
  "message": string
}

DELETE /system/api/v1/vampdatabase

Delete data from a collection

Headers:
Authorization: Bearer <token>
Content-Type: application/json
Request Body:
{
  "collection": string,
  "query": object
}
Response:
{
  "success": boolean,
  "deletedCount": number,
  "message": string
}

For more information or support, contact the system administrator.