The docs give examples of sending a request to each API endpoint. Each example tells the required request method, the URL to reach the endpoint, and any necessary headers to include in the request (almost every endpoint requires you to include an access token, see here).
An example of hitting the send channel message endpoint in PHP.
<?php
// Initialize cURL, set URL to "send channel message" endpoint, set POST method,
// set access token header
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.nightbot.tv/1/channel/send");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ACCESS_TOKEN"));
curl_setopt($ch, CURLOPT_POSTFIELDS, "message=Hello World!");
curl_exec($ch);
// Job's done, close the cURL session
curl_close($ch);
?>
An example of hitting the same endpoint in AJAX, copied from my other post.
$.ajax({
url: "https://api.nightbot.tv/1/channel/send",
method: "POST",
headers: {
"Authorization":"Bearer ACCESS_TOKEN",
},
data: "message=Hello World!"
});