Event API
Last updated
Last updated
Event also allows you to emit and transact on messages using the Event API.
Head over to the Secret Keys section in the Settings page:
Click the + Create secret key
button
Name your Secret Key
Click Create
To authenticate and use any of the below API endpoints, you'll need to pass an Event Secret Key in the headers.
BUILDABLE_SECRET_KEY
GET
X-Buildable-Secret
{"status":"success","key":"2b4bc1689000424287d1e68e6e8cf3d1"}
POST /emit HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 25
{
"event": "",
"payload": {}
}
{
"status": "success",
"key": "2b4bc1689000424287d1e68e6e8cf3d1"
}
does-not-exist
Possible values: 1
10
POST /query HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 115
{
"eventName": "",
"txKey": "",
"since": null,
"platform": "",
"label": "",
"txState": "does-not-exist",
"page": 1,
"pageSize": 10
}
{
"rows": [
{
"_id": "text",
"key": "text",
"eventName": "text",
"environment": "text",
"payload": null,
"query": null,
"headers": null,
"createdAt": 1,
"state": "text",
"history": [
{
"enterState": "text",
"exitState": "text",
"timestamp": 1,
"updatedBy": "text"
}
],
"ttl": 1,
"v": 1,
"ownership": {
"buildableId": "text",
"userId": "text",
"clientId": "text"
},
"processing": {
"hasTransactions": true,
"totalTransactions": 1,
"hasFutureTransactions": true,
"isCompleted": true
}
}
],
"total": 1,
"page": 1,
"pageSize": 1,
"totalPages": 1
}
processing
Possible values: POST /update HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 59
{
"key": "",
"eventName": "",
"txKey": "",
"txState": "processing"
}
{
"_id": "text",
"key": "text",
"eventName": "text",
"environment": "text",
"payload": null,
"query": null,
"headers": null,
"createdAt": 1,
"state": "text",
"history": [
{
"enterState": "text",
"exitState": "text",
"timestamp": 1,
"updatedBy": "text"
}
],
"ttl": 1,
"v": 1,
"ownership": {
"buildableId": "text",
"userId": "text",
"clientId": "text"
},
"processing": {
"hasTransactions": true,
"totalTransactions": 1,
"hasFutureTransactions": true,
"isCompleted": true
}
}
POST /init HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"key": "",
"txKey": ""
}
{
"_id": "text",
"key": "text",
"txn": "text",
"event": {
"_id": "text",
"eventName": "text"
},
"createdAt": 1,
"ttl": 1,
"state": "text",
"history": [
{
"enterState": "text",
"exitState": "text",
"timestamp": 1,
"updatedBy": "text"
}
],
"startedAt": 1,
"txKey": "text",
"endedAt": 1
}
finished
Possible values: POST /transact HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"key": "",
"txKey": "",
"output": "",
"state": "finished"
}
{
"_id": "text",
"key": "text",
"txn": "text",
"event": {
"_id": "text",
"eventName": "text"
},
"createdAt": 1,
"ttl": 1,
"state": "text",
"history": [
{
"enterState": "text",
"exitState": "text",
"timestamp": 1,
"updatedBy": "text"
}
],
"startedAt": 1,
"txKey": "text",
"endedAt": 1
}
POST /get-full-event-name HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 41
{
"eventName": "",
"platform": "",
"label": ""
}
{
"fullName": "text"
}