Links

Guild - /guild

Methods used to retrieve info about uptime of your robots.

Base URL

https://api.watchbot.app
get
https://api.watchbot.app
/guild/:id
Uptime of monitored robots
To get the authentication token, go to your server overview (https://dash.watchbot.app) and you will find it at the top.

Examples

NodeJS
Python
PHP
const fetch = require('node-fetch')
const serverID = ""
const apiToken = ""
fetch(`https://api.watchbot.app/guild/${serverID}`, {
headers: {
'AUTH-TOKEN': apiToken
}
})
.then(response => response.json())
.then(result => {
console.log(result)
})
# Author : baptiste0928 (https://baptiste0928.net)
import aiohttp
import requests
from typing import Dict # Used for typing (optional)
import asyncio # Used for examples
def get_uptime(serverID: str, *, auth_token: str) -> Dict[str, str]:
"""Simple function to interact with the Watchbot api using requests."""
headers = {"AUTH-TOKEN": auth_token}
r = requests.get("https://api.watchbot.app/guild/" + serverID, headers=headers)
return r.json()
async def get_uptime_async(serverID: str, *, auth_token: str) -> Dict[str, str]:
"""Simple async function to interact with the Watchbot api using aiohttp."""
async with aiohttp.ClientSession() as session:
headers = {"AUTH-TOKEN": auth_token}
async with session.get("https://api.watchbot.app/guild/" + serverID, headers=headers) as r:
return await r.json()
# Usage example
serverID = ""
auth_token = ""
print(get_uptime(serverID, auth_token=auth_token))
print(asyncio.get_event_loop().run_until_complete(get_uptime_async(serverID, auth_token=auth_token)))
<?php
// Author : Adrien Luitot (https://adrien.luitot.fr)
$apiToken = ""; // Here put your token
$serverId = ""; // Here your server id
$curl = curl_init('https://api.watchbot.app/guild/' . $serverId);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_HTTPHEADER, ['AUTH-TOKEN: ' . $apiToken]);
$response = curl_exec($curl);
echo $response;
?>