Bloodbath API
Search…
Working with REST
The Bloodbath API is organized around REST.
Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Prerequisite

Get the list of events

1
curl <https://api.bloodbath.io/rest/events/> \\
2
-H "Authorization: Bearer <Replace this with your API key>"
3
4
# OK Response
5
{
6
"data": [
7
{
8
"endpoint": "<https://test.com>",
9
"enqueued_at": null,
10
"headers": "{}",
11
"id": "226a9043-120e-49a5-a3ca-e942915020e4",
12
"origin": "rest_api",
13
"body": "{test: true}",
14
"processed_at": null,
15
"scheduled_for": "2021-05-09T00:04:34Z"
16
},
17
{
18
"endpoint": "<https://test.com>",
19
"enqueued_at": null,
20
"headers": "{}",
21
"id": "2d8e90be-4e3c-4236-8de9-9473b3143c26",
22
"origin": "rest_api",
23
"body": "{test: true}",
24
"processed_at": null,
25
"scheduled_for": "2021-05-09T00:04:36Z"
26
},
27
]
28
}
Copied!

Find a specific event

1
curl <https://api.bloodbath.io/rest/events/><UUID of the event> \\
2
-H "Authorization: Bearer <Replace this with your API key>"
3
4
# OK Response
5
{
6
"data": {
7
"endpoint": "<https://test.com>",
8
"enqueued_at": null,
9
"headers": "{}",
10
"id": "226a9043-120e-49a5-a3ca-e942915020e4",
11
"origin": "rest_api",
12
"body": "{test: true}",
13
"processed_at": null,
14
"scheduled_for": "2021-05-09T00:04:34Z"
15
}
16
}
Copied!

Schedule a new event

1
curl <https://api.bloodbath.io/rest/events/> \\
2
-H "Authorization: Bearer <Replace this with your API key>" \\
3
-d scheduled_for="2021-05-01T00:00:00Z" \\
4
-d headers="{}" \\
5
-d body="{test: test}" \\
6
-d method="post" \\
7
-d endpoint="<https://dummy.bloodbath.io>"
8
9
# OK Response
10
{
11
"data": {
12
"endpoint": "<https://test.com>",
13
"enqueued_at": null,
14
"headers": "{}",
15
"id": "226a9043-120e-49a5-a3ca-e942915020e4",
16
"origin": "rest_api",
17
"body": "{hello:true}",
18
"processed_at": null,
19
"scheduled_for": "2021-05-09T00:04:34Z"
20
}
21
}
Copied!

Cancel an existing event

You can't cancel events that were already enqueued and/or processed
1
curl <https://api.bloodbath.io/rest/events/><UUID of the event> \\
2
-H "Authorization: Bearer <Replace this with your API key>" \\
3
-X DELETE
4
5
# OK Response
6
{
7
"data": null
8
}
Copied!
Last modified 28d ago