Skip to content

Instantly share code, notes, and snippets.

View billforward-alex's full-sized avatar

Alex Birch billforward-alex

View GitHub Profile
@billforward-alex
billforward-alex / subscribing your webhook to additional audit events.md
Created August 3, 2017 15:19
Subscribing your webhook to additional audit events
#!/bin/bash

# https://sipb.mit.edu/doc/safe-shell/
set -euf -o pipefail

command -v jq >/dev/null 2>&1 || { echo >&2 "I require 'jq' but it's not installed. Try 'brew install jq'. Aborting."; exit 1; }

trap "echo 'Command syntax: BF_add_webhook_sub.sh private_token bf_subdomain webhook_subscriptions [specific_webhook_id]
Example invocation: ./BF_add_webhook_sub.sh MY_PRIVATE_TOKEN api-sandbox \"Account.Created,Subscription.Paid\"'" EXIT SIGHUP SIGINT SIGTERM