Bloodbath API
Search…
Working with GraphQL
Bloodbath proposes a powerful GraphQL API.
It's the same API we use internally for developing our applications, most notably our own dashboard. We follow a Relay style of schema.
If you're new to GraphQL, Apollo has resources for beginners. The official documentation is another good starting point.

Prerequisite

Endpoint

Bloodbath's GraphQL endpoint is:
1
https://api.bloodbath.io/graphql
Copied!
It supports introspection so you can query the whole schema.

Authorization

To start querying the endpoint, you must add the API key to your authorization headers.
1
{
2
"headers": {
3
"authorization": "Bearer <Your API key>"
4
}
5
}
Copied!

Check your access

Once you have the headers in place you can ping the GraphQL API
1
query ping {
2
ping {
3
receivedAt
4
}
5
}
Copied!
It should respond with something like
1
{
2
"data": {
3
"ping": {
4
"receivedAt": "2021-05-23T20:45:44.409594Z"
5
}
6
}
7
}
Copied!

Examples

List events

1
query listEvents {
2
listEvents(first: 5) {
3
pageInfo {
4
startCursor
5
}
6
edges {
7
node {
8
id
9
eventId
10
method
11
lockedAt
12
}
13
}
14
}
15
}
Copied!
You'll notice that a difference between id and eventId; we have a Relay style schema. It means we have to map a node id and the event id has to be put on the side.

Find an event

1
query findEvent{
2
findEvent(
3
id: "f6596250-044b-4070-a256-31f0977ea4f3"
4
) {
5
eventId
6
scheduledFor
7
}
8
}
Copied!
Last modified 28d ago