Cabinhub News API v1.0.0

Docs / List delivery outbox rows, newest first, with the endpoint masked

List delivery outbox rows, newest first, with the endpoint masked

List delivery outbox rows, newest first, with the endpoint masked

GET/v1/admin/webhooks/deliveries
Auth
X-Admin-Token
Cache-Control
no-store
Source of truth
clients/openapi.json and docs/API.md §12

One page of deliveries. See the module docstring for order, cursor and masking.

`limit is validated here rather than by Query(ge=..., le=...) so a bad page size is the same documented 400 a bad status gets, instead of FastAPI's 422` envelope. One error shape per route is what a client can code against.

Description: clients/openapi.json

Parameters

NameInRequiredTypeExampleNotes
statusquerynostringpending | delivered | dead
endpointquerynostringthe MASKED endpoint shown by this route (scheme://host/#hash); a raw URL is refused
limitquerynointeger2page size, 1..200 (default 50)
cursorquerynostring<next_cursor>opaque cursor from a previous page
X-Admin-TokenheadernostringOperator token (NEWS_ADMIN_TOKEN). A client bearer is refused here.

Following next_cursor is a loop; see Pagination for the walk in curl, Python and TypeScript.

Example request

curl
Shell
curl -sS \
  'https://vg.tempproject.online/v1/admin/webhooks/deliveries?limit=2' \
  -H "X-Admin-Token: $NEWS_ADMIN_TOKEN"
Python, standard library only
Python
import json
import os
import urllib.request

URL = "https://vg.tempproject.online/v1/admin/webhooks/deliveries?limit=2"


def call() -> dict:
    req = urllib.request.Request(URL, headers={
        "X-Admin-Token": os.environ["NEWS_ADMIN_TOKEN"],
    })
    with urllib.request.urlopen(req, timeout=15) as res:
        print(res.status, res.headers.get("ETag"))
        return json.loads(res.read().decode("utf-8"))


if __name__ == "__main__":
    body = call()
    print(json.dumps(body, indent=2, ensure_ascii=False)[:2000])
TypeScript, Node 18+, no dependencies
TypeScript
const res = await fetch(
  "https://vg.tempproject.online/v1/admin/webhooks/deliveries?limit=2",
  {
    method: "GET",
    headers: {
      "x-admin-token": process.env.NEWS_ADMIN_TOKEN!,
    },
  },
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());

The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.

Example response

Response body
HTTP
cache-control: no-store
content-type: application/octet-stream

No JSON body on this route; the headers are the ones docs/API.md §2 documents for it

Failures

This operation can answer 200, 400, 401, 404, 409, 422, 503. The full envelope for each status, with its body, is on Errors.