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

Areas

4 endpoints. Every address starts with https://api.samplebot.app/v1/servers/{server id}.

GET/regions regions:read

Areas drawn on the map.

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

GET/regions/:id regions:read

One area, with who is in it now.

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

POST/regions regions:write

Draw an area from map points.

NameInDescription
name requiredbody
points requiredbody[[x, z], ...] in map studs, at least 3
colourbody#rrggbb
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/regions" \
  -H "Authorization: Bearer $SAMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"...","points":"..."}'

DELETE/regions/:id regions:write

Delete an area.

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