GET /events

List Events

Returns published events for the authenticated business, ordered by most recent first. Draft and archived events are excluded. Uses a count-based limit instead of pagination.

Events Authentication required

Parameters

  • X-Public-Key (header, string, required): Your business public key. Used to identify which business is making the request.
  • X-Timestamp (header, string, required): Current Unix timestamp in seconds. Requests older than 5 minutes are rejected.
  • X-Signature (header, string, required): HMAC-SHA256 signature of the signing string: {timestamp}\n{METHOD}\n{path}\n{body}, using your private key as the secret.
  • count (query, integer): Number of events to return (default 10). Clamped to 1–100.

Responses

  • 200: A list of published events.
  • 401: Missing credentials, expired timestamp, or invalid signature.
  • 403: Business account exists but is not active.
  • 429: Rate limit exceeded (60 requests/minute per key).

cURL

PUBLIC_KEY="pk_live_..."
PRIVATE_KEY="sk_live_..."
TIMESTAMP=$(date +%s)
PATH_URI="/api/v1/events?count=5"

SIGNATURE=$(printf '%s\n%s\n%s\n' "$TIMESTAMP" "GET" "$PATH_URI" \
  | openssl dgst -sha256 -hmac "$PRIVATE_KEY" | awk '{print $2}')

curl -H "X-Public-Key: $PUBLIC_KEY" \
     -H "X-Timestamp: $TIMESTAMP" \
     -H "X-Signature: $SIGNATURE" \
     "https://backend.localbusiness.pro$PATH_URI"

Node.js

const crypto = require("crypto");

const publicKey = "pk_live_...";
const privateKey = "sk_live_...";
const timestamp = Math.floor(Date.now() / 1000).toString();
const method = "GET";
const path = "/api/v1/events?count=5";
const body = "";

const signingString = `${timestamp}\n${method}\n${path}\n${body}`;
const signature = crypto
  .createHmac("sha256", privateKey)
  .update(signingString)
  .digest("hex");

const response = await fetch("https://backend.localbusiness.pro/api/v1/events?count=5", {
  headers: {
    "X-Public-Key": publicKey,
    "X-Timestamp": timestamp,
    "X-Signature": signature,
  },
});

const data = await response.json();
console.log(data);

Python

import hmac, hashlib, time, requests

public_key = "pk_live_..."
private_key = "sk_live_..."
timestamp = str(int(time.time()))
method = "GET"
path = "/api/v1/events?count=5"
body = ""

signing_string = f"{timestamp}\n{method}\n{path}\n{body}"
signature = hmac.new(
    private_key.encode(), signing_string.encode(), hashlib.sha256
).hexdigest()

response = requests.get(
    "https://backend.localbusiness.pro/api/v1/events?count=5",
    headers={
        "X-Public-Key": public_key,
        "X-Timestamp": timestamp,
        "X-Signature": signature,
    },
)
print(response.json())

PHP

<?php
$publicKey = 'pk_live_...';
$privateKey = 'sk_live_...';
$timestamp = time();
$method = 'GET';
$path = '/api/v1/events?count=5';
$body = '';

$signingString = $timestamp . "\n" . $method . "\n" . $path . "\n" . $body;
$signature = hash_hmac('sha256', $signingString, $privateKey);

$ch = curl_init('https://backend.localbusiness.pro/api/v1/events?count=5');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-Public-Key: $publicKey",
    "X-Timestamp: $timestamp",
    "X-Signature: $signature",
]);

$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));