Bot API
Tickets
6 endpoints. Every address starts with https://api.samplebot.app/v1/servers/{server id}.
GET/tickets tickets:read
Tickets. Open and claimed by default; status=CLOSED for closed ones.
| Name | In | Description |
|---|---|---|
status | query | OPEN, CLAIMED or CLOSED |
userId | query | |
limit | query |
curl "https://api.samplebot.app/v1/servers/{server id}/tickets" \
-H "Authorization: Bearer $SAMPLE_API_KEY"
GET/tickets/stats tickets:read
Counts: open, claimed, closed this week.
curl "https://api.samplebot.app/v1/servers/{server id}/tickets/stats" \
-H "Authorization: Bearer $SAMPLE_API_KEY"
GET/tickets/:id tickets:read
One ticket.
| Name | In | Description |
|---|---|---|
id required | path |
curl "https://api.samplebot.app/v1/servers/{server id}/tickets/{id}" \
-H "Authorization: Bearer $SAMPLE_API_KEY"
POST/tickets/:id/claim tickets:write
Claim a ticket as a staff member. Their own permissions are checked.
| Name | In | Description |
|---|---|---|
id required | path | |
userId required | body | the staff member |
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/tickets/{id}/claim" \
-H "Authorization: Bearer $SAMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userId":"1246251869798400001"}'
POST/tickets/:id/unclaim tickets:write
Let a claimed ticket go.
| Name | In | Description |
|---|---|---|
id required | path | |
userId required | body |
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/tickets/{id}/unclaim" \
-H "Authorization: Bearer $SAMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userId":"1246251869798400001"}'
POST/tickets/:id/close tickets:write
Close a ticket with a transcript, as a staff member allowed to.
| Name | In | Description |
|---|---|---|
id required | path | |
userId required | body | |
reason | body |
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/tickets/{id}/close" \
-H "Authorization: Bearer $SAMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userId":"1246251869798400001"}'