To get started with the Bot Butcher API, follow these simple steps:
API key
and a Form ID
for each contact form you want to integrate.true
spam or false
(not spam).Check out and download our Postman Collection
Detects if a given message is spam or not.
Base URL: https://api.botbutcher.com
Method: POST
x-api-key
: (Required) API key to authenticate the request.form
: (Required, string) The form identifier.message
: (Required, string) The text to classify as spam or not.Example Payload:
{
"form": "YOUR-FORM-ID",
"message": "The spammy message posted to your contact form."
}
Example Request:
curl -X POST -H 'Content-Type: application/json' -H 'x-api-key: YOUR-API-KEY' -d '{"form": "YOUR-FORM-ID", "message": "The spammy message posted to your contact form."}' 'https://api.botbutcher.com'
import requests headers = { 'Content-Type': 'application/json', 'x-api-key': 'YOUR-API-KEY' } data = { 'form': 'YOUR-FORM-ID', 'message': 'Your message' } response = requests.post('https://api.botbutcher.com', json=data, headers=headers) print(response.json())
const xhr = new XMLHttpRequest(); const data = JSON.stringify({ form: 'YOUR-FORM-ID', message: 'The spammy message posted to your contact form.' }); xhr.open('POST', 'https://api.botbutcher.com'); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('x-api-key', 'YOUR-API-KEY'); xhr.send(data); xhr.onload = function() { if (xhr.status === 200) { console.log(JSON.parse(xhr.responseText)); } };
spam
: (boolean) Indicates if the message is classified as spam (true
) or not (false
).message_id
: (string) A unique identifier for the message.status_code
: (integer) HTTP status code indicating the success or failure of the request.Example Response:
{
"spam": true,
"message_id": "2383k0f-s5cPjaQBi1-87s10",
"status_code": 200
}
Malformed request
: Returned when there's a missing JSON payload, form value, message value, or required headers. Status code: 400
.Unauthorized
: Returned when the authentication fails. Status code: 403
.Retrieve any message previously sent by the message_id
Base URL: https://api.botbutcher.com
Endpoint: /message/<message_id>
Method: GET
Allows user to retrieve a Message object by its unique identifier.
Headers:
x-api-key
: (Required) API key to authenticate the request.URL Parameters:
message_id
: (Required, string) The unique identifier of the message to be retrieved.Example Request:
curl -H 'x-api-key: YOUR-API-KEY' 'https://api.botbutcher.com/message/message_id'
import requests headers = { 'x-api-key': 'YOUR-API-KEY' } response = requests.get('https://api.botbutcher.com/message/message_id', headers=headers) print(response.json())
const xhr = new XMLHttpRequest(); xhr.open('GET', 'https://api.botbutcher.com/message/message_id'); xhr.setRequestHeader('x-api-key', 'YOUR-API-KEY'); xhr.send(); xhr.onload = function() { if (xhr.status === 200) { console.log(JSON.parse(xhr.responseText)); } };
status_code
: (integer) HTTP status code indicating the success or failure of the request.timestamp
: (string) The ISO 8601 format timestamp representing when the message was created.message
: (string) The text content of the message.spam
: (boolean) Indicates if the message is classified as spam (true
) or not (false
).form_id
: (string) The form identifier related to the message.Example:
{
"status_code": 200,
"timestamp": "2022-04-18T10:15:30Z",
"message": "The spammy message posted to your contact form.",
"spam": true,
"form_id": "YOUR FORM ID"
}
Malformed request
: Returned when there's a missing message_id
, unknown message_id
, or required headers. Status code: 400
.Unauthorized
: Returned when the authentication fails. Status code: 403
.