Bot - /bot
With our API, you can create, edit or delete your bots params ! Note: Only for Certified Bots by Watchbot.

Base URL

1
https://api.watchbot.app
Copied!
To get the authentication token, go to your bot section (https://watchbot.app) and you will find it in the settings page.
get
https://api.watchbot.app
/bot/:id
Bot
get
https://api.watchbot.app
/bot/:id/uptime
Uptime
Only for Watchbot VIP+ subscribers. More info: watchbot.app/vip
post
https://api.watchbot.app
/bot/:id/announcement/edit
Announcement
delete
https://api.watchbot.app
/bot/:id/announcement
Announcement
get
https://api.watchbot.app
/bot/:id/incidents
Incidents / Status
post
https://api.watchbot.app
/bot/:id/incidents/create
Create an Incident
post
https://api.watchbot.app
/bot/:id/incident/:iid/edit
Edit an incident
delete
https://api.watchbot.app
/bot/:id/incidents/:iid
Delete an incident
post
https://api.watchbot.app
/bot/:id/incidents/:iid/status/create
Create a status
post
https://api.watchbot.app
/bot/:id/incidents/:iid/status/:sid/edit
Edit a status
delete
https://api.watchbot.app
/bot/:id/incidents/:iid/status/:sid
Delete a status

Examples:

NodeJS
Python
PHP
1
const axios = require('axios')
2
const fetch = require('node-fetch')
3
4
const botid = ""
5
const apiToken = ""
6
7
// Method: GET
8
fetch(`https://api.watchbot.app/bot/${botID}/incidents`, {
9
headers: {
10
'AUTH-TOKEN': apiToken
11
}
12
}).then(response => response.json()).then(result => {
13
console.log(result)
14
})
15
16
// Method: POST
17
const data = {
18
title: "Title",
19
type: "Partial Outage",
20
date: "2021-01-01"
21
}
22
const content = JSON.stringify(data, null);
23
axios.post(`https://api.watchbot.app/bot/${botID}/incidents/create`, content, {
24
headers: {
25
'Content-Type': 'application/json',
26
'Content-Length': content.length,
27
'AUTH-TOKEN': apiToken
28
}
29
}).then((res) => {
30
console.log(res["data"])
31
})
32
33
// Method: DELETE
34
axios.delete(`https://api.watchbot.app/bot/${botID}/incidents/26/status/658`, {
35
headers: {
36
'AUTH-TOKEN': apiToken
37
}
38
}).then((res) => {
39
console.log(res["data"])
40
})
Copied!
1
# Author : baptiste0928 (https://baptiste0928.net)
2
3
import aiohttp
4
import requests
5
from typing import Dict # Used for typing (optional)
6
import asyncio # Used for examples
7
8
def get_uptime(botID: str, *, auth_token: str) -> Dict[str, str]:
9
"""Simple function to interact with the Watchbot api using requests."""
10
headers = {"AUTH-TOKEN": auth_token}
11
r = requests.get("https://api.watchbot.app/bot/" + botID, headers=headers)
12
return r.json()
13
14
async def get_uptime_async(botID: str, *, auth_token: str) -> Dict[str, str]:
15
"""Simple async function to interact with the Watchbot api using aiohttp."""
16
async with aiohttp.ClientSession() as session:
17
headers = {"AUTH-TOKEN": auth_token}
18
async with session.get("https://api.watchbot.app/bot/" + botID, headers=headers) as r:
19
return await r.json()
20
21
# Usage example
22
botID = ""
23
auth_token = ""
24
25
print(get_uptime(botID, auth_token=auth_token))
26
27
print(asyncio.get_event_loop().run_until_complete(get_uptime_async(botID, auth_token=auth_token)))
Copied!
1
<?php
2
3
// Author : Adrien Luitot (https://adrien.luitot.fr)
4
5
$apiToken = ""; // Here put your token
6
$botId = ""; // Here your bot id
7
8
$curl = curl_init('https://api.watchbot.app/bot/' . $botId);
9
10
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
11
curl_setopt($curl, CURLOPT_HTTPHEADER, ['AUTH-TOKEN: ' . $apiToken]);
12
13
$response = curl_exec($curl);
14
echo $response;
15
16
?>
Copied!
Last modified 4mo ago