Skip to content

thoroai/webhook-receiver-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local webhook receiver

Quickstart

  1. Create a venv and install deps:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
  1. Run a reverse proxy (e.g, ngrok or Tailscale Funnel)
  2. Configure an API client in the Portal, and configure it with the reverse proxy address
  3. Add the API client to a team
  4. Add the team to a fleet / region, with the appropriate notifications enabled
  5. Configure the script with the downloaded HMAC secret from step 3, and an optional bearer token (provided by the end user)
  6. Run the server:
python app.py

Server listens on http://localhost:8000

Endpoints

  • POST /webhook -> accepts an asynchronous webhook call from the Thoro Portal

Example expected payload shape

{
  "event": "ai.thoro.device.power_on",
  "message": "Power on event",
  "body": {
    "robot_id": "0016338",
    "fleet_id": "1",
    "timestamp": 1765890030
  }
}

Example curl

curl -X POST http://localhost:8000/webhook \
  -H 'Content-Type: application/json' \
  -d '{
    "event":"ai.thoro.device.power_on",
    "message":"Power on event",
    "body":{"robot_id":"0016338","fleet_id":"1","timestamp":1765890030}
  }'

About

Webhook Receiver Example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages