#!/usr/bin/env bash # Sign up for free developer access from a terminal: the same request the landing page's form sends. No token needed. # bash examples/curl/signup.sh you@example.com "What you want to build" ["Your name"] # bash examples/curl/signup.sh --lost you@example.com # lost your token: email me a one-time link # The answer is always 202 {"status": "received", "message": ...}, whatever the address: then check your inbox. # open mode: a link that creates your account and shows your API token once # approval mode: a confirmation now, and a link to your token when the team approves you # 400 validation_error names the field; 404 means sign-up is off; 429 rate_limited says when to retry (Retry-After). # WEBPILOT_URL: the gateway (https://webpilot.si for the hosted service; default a local gateway). set -euo pipefail : "${WEBPILOT_URL:=http://localhost:8931}" if [ "${1:-}" = "--lost" ]; then BODY=$(python3 -c 'import json,sys; print(json.dumps({"email": sys.argv[1]}))' "${2:?email}") curl -sS -X POST "$WEBPILOT_URL/v1/token-recovery" -H "content-type: application/json" -d "$BODY" -w "\nHTTP %{http_code}\n" exit fi EMAIL=${1:?email}; USE=${2:?what you want to build}; NAME=${3:-} BODY=$(python3 -c 'import json,sys; d={"email":sys.argv[1],"use_case":sys.argv[2]}; sys.argv[3] and d.update(name=sys.argv[3]); print(json.dumps(d))' "$EMAIL" "$USE" "$NAME") curl -sS -X POST "$WEBPILOT_URL/v1/signup" -H "content-type: application/json" -d "$BODY" -w "\nHTTP %{http_code}\n"