Webhooks
Create a webhook with POST /cloud/webhooks; the 64-hex secret is shown once. Verify every delivery:
import hmac, hashlib, time
def valid(secret, ts, body, signature):
if abs(time.time() - int(ts)) > 300: return False
mac = hmac.new(secret.encode(), (ts + "." + body).encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest("sha256=" + mac, signature)
Headers: X-Gyro-Event, X-Gyro-Delivery, X-Gyro-Timestamp, X-Gyro-Signature. Answer 2xx within 4 seconds.