Open this on a computer

The Sample Bot API site is made for a computer, where you write code. Visit api.samplebot.app on your computer.

Back to samplebot.app

Sample Bot API

Bot API

Automations

4 endpoints. Every address starts with https://api.samplebot.app/v1/servers/{server id}. Plus endpoints need Sample Plus+ in the server.

GET/automations automations:read

Automations in this server.

curl "https://api.samplebot.app/v1/servers/{server id}/automations" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

GET/automations/:number automations:read

One automation.

NameInDescription
number requiredpath
curl "https://api.samplebot.app/v1/servers/{server id}/automations/{number}" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

POST/automations/:number/run automations:writePlus

Run an automation now, with optional values for its text.

NameInDescription
number requiredpath
contextbodyvalues for {placeholders}, e.g. { "player": { "name": "Roman_RP" } }
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/automations/{number}/run" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

POST/automations/:number/enabled automations:writePlus

Switch an automation on or off.

NameInDescription
number requiredpath
enabled requiredbodytrue or false
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/automations/{number}/enabled" \
  -H "Authorization: Bearer $SAMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'