Event (old)
WebsiteSign Up
  • Event Documentation
  • Introduction
    • Quick Start
    • System Architecture
    • Event Link
  • Connections
    • Add a New Connection
    • Source Catalog
      • Adyen
      • Alchemy
      • Checkout.com
      • CircleCI
      • Datadog
      • FTP Servers
      • Github
      • GitLab
      • Node.js
      • PagerDuty
      • PayPal
      • ShipStation
      • Shopify
      • Square
      • Stripe
      • Webflow
      • Webhooks
      • WooCommerce
    • Destination Catalog
      • Elasticsearch
      • Firestore
      • MongoDB
      • PostgreSQL
      • Stripe
      • Webhooks
    • New Connection Development
  • Pipelines
    • Create a Pipeline
    • Enrich your Data
    • Set a Retry Policy
  • Monitoring
    • View Live Events
  • Resources
    • Legal
      • Terms of Service
      • Privacy Policy
    • Other
      • Login Connections
      • Event API
Powered by GitBook
On this page
  1. Resources
  2. Other

Event API

PreviousLogin Connections

Last updated 2 years ago

Overview

Event also allows you to emit and transact on messages using the Event API.

Generate an Event API Key

Head over to the Secret Keys section in the Settings page:

  1. Click the + Create secret key button

  2. Name your Secret Key

  3. Click Create

Ensure you store the test and live keys somewhere safe (like a password manager).

Authentication

To authenticate and use any of the below API endpoints, you'll need to pass an Event Secret Key in the headers.

Header
Value

BUILDABLE_SECRET_KEY

API Endpoints

GET

Swagger

X-Buildable-Secret
  • Overview
  • Generate an Event API Key
  • Authentication
  • API Endpoints
  • POSTEmit a custom event
  • POSTQuery Events
  • POSTUpdate Event
  • POSTInitiate a transaction
  • POSTRun a transaction
  • POSTGet the full event name
  • Swagger

Emit a custom event

post
Body
eventstringRequired
payloadobjectRequired
Responses
200
Emit Response
application/json
ResponseobjectExample: {"status":"success","key":"2b4bc1689000424287d1e68e6e8cf3d1"}
401
Unauthorized
application/json
422
Fields invalid
application/json
default
Server Error
application/json
post
POST /emit HTTP/1.1
Host: events.buildable.dev
Content-Type: application/json
Accept: */*
Content-Length: 25

{
  "event": "",
  "payload": {}
}
{
  "status": "success",
  "key": "2b4bc1689000424287d1e68e6e8cf3d1"
}

Query Events

post
Body
eventNamestringRequired
txKeystringRequired
sincenumberRequired
platformstringOptional
labelstringOptional
txStatestring ยท enumOptionalDefault: does-not-existPossible values:
pagenumberOptionalDefault: 1
pageSizenumber ยท max: 100OptionalDefault: 10
Responses
200
Query Response
application/json
401
Unauthorized
application/json
422
Fields invalid
application/json
default
Server Error
application/json
post
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
}

Update Event

post
Body
keystringRequired
eventNamestringRequired
txKeystringRequired
txStatestring ยท enumRequiredExample: processingPossible values:
Responses
200
Update Response
application/json
401
Unauthorized
application/json
422
Fields invalid
application/json
default
Server Error
application/json
post
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
  }
}

Initiate a transaction

post
Body
keystringRequired
txKeystringRequired
Responses
200
Init Response
application/json
401
Unauthorized
application/json
422
Fields invalid
application/json
default
Server Error
application/json
post
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
}

Run a transaction

post
Body
keystringRequired
txKeystringRequired
outputstringOptional
statestring ยท enumRequiredExample: finishedPossible values:
Responses
200
Transact Response
application/json
401
Unauthorized
application/json
422
Fields invalid
application/json
default
Server Error
application/json
post
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
}

Get the full event name

post
Body
eventNamestringRequired
platformstringOptional
labelstringOptional
Responses
200
Get Full Event Name Response
application/json
401
Unauthorized
application/json
422
Fields invalid
application/json
default
Server Error
application/json
post
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"
}
Build, Collaborate & Integrate APIs | SwaggerHub
Logo