CollabVM API v2
Here are various endpoints that can be used to pull data from CollabVM
All endpoints can be accessed at https://cvmapi.elijahr.dev
VM List
GET /api/v2/list
Get a list of VMs the bot has access to, and their node IDs.
VM Info
GET /api/v1/vms/{vm}
Pull some data about the current state of the VM.
Returns the following data, in JSON format:
id
: Node ID of the VMusers
: Current online users on the VM. Each user is an object with the following properties:username
: Username of the userrank
: 0 (Unregistered), 1 (Registered), 2 (Admin), or 3 (Mod)country
: ISO country code for this user, if available
Screenshot
GET /api/v1/vms/{vm}/screenshot
Grab a screenshot of the VM. Returns it as a WEBP image.
Chat Logs
GET /api/v1/chat
Grab chats from the logs. Data goes back to 06/30/2022.
Accepts the following optional query parameters:
vm
: Filter to one VM. Formatted asVM{1-8}
username
: Filter to one usernamefrom
: Filter to messages after the specified timestamp, in ISO format. Times in UTCto
: Filter to messages before the specified timestamp, in ISO format. Times in UTClimit
: Truncate result to n messages. Must be a positive integer. If neitherlimit
,from
, orto
are set, this defaults to 100.search
: Message search query. Whole words only. Use quotes to search for phrases.
If you do not provide any query parameters it simply returns the last 100 messages logged.
Returns a JSON array with an entry for each message. A message is represented by an object with the following properties:
username
: User who sent the messagemessage
: The chat messagetimestamp
: Time the message was sent, in ISO format. Times in UTCvm
: VM the message was sent to.