Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Crafting a Great Webhooks Experience
Search
John Sheehan
November 20, 2015
Technology
560
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Crafting a Great Webhooks Experience
Presented at API Strategy and Practice 2015 #apistrat
John Sheehan
November 20, 2015
More Decks by John Sheehan
See All by John Sheehan
My Favorite API Tools (Other than Runscope)
johnsheehan
0
210
Glue 2015: Microservices - More than just a buzzword.
johnsheehan
2
780
Scale-Oriented Architecture with Microservices
johnsheehan
2
390
Crafting a Great Webhooks Experience
johnsheehan
0
220
The rise of distributed applications.
johnsheehan
2
500
Zen and the Art of API Maintenance
johnsheehan
2
2.5k
Building API integrations you can live with.
johnsheehan
0
160
Free API debugging and testing tools you should know about.
johnsheehan
5
880
Modern Tools for Modern Applications
johnsheehan
1
210
Other Decks in Technology
See All in Technology
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
210
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
SDDの運用にめげずに向き合った話
sansantech
PRO
1
130
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
330
FinTech 1-2 : Overview of FinTech
ks91
PRO
0
150
生成AIと進める探索的データ分析(2026.10.03 第122回Tokyo.R勉強会)
tatamiya
2
1.4k
Google Cloud Next Tokyo 26登壇時のスクリプト
recruitengineers
PRO
0
200
形式手法を使って仕様をコーディングしよう
mikanichinose
0
180
IR Today: Theory, Practice, and Agents
dtunkelang
0
350
自分で立ててみるLLMサービス
y_sera15
0
110
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.1k
Featured
See All Featured
Thoughts on Productivity
jonyablonski
76
5.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Done Done
chrislema
187
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
WENDY [Excerpt]
tessaabrams
14
40k
Statistics for Hackers
jakevdp
799
230k
Discover your Explorer Soul
emna__ayadi
2
1.3k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
500
Mobile First: as difficult as doing things right
swwweet
225
10k
Ruling the World: When Life Gets Gamed
codingconduct
0
390
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
400
How to Ace a Technical Interview
jacobian
280
24k
Transcript
Crafting a Great Webhooks Experience John Sheehan CEO, @Runscope
None
None
None
None
None
"user defined callbacks made with HTTP POST"
"Webhooks are the easiest way to remotely execute code." --
Jeff Lindsay once when we were talking
HTTP Push Notifications
A Reverse API
Provider makes request to URL when an event happens. Consumer
sets up a server to listen for callbacks. Consumer registers callback URL with provider.
Provider makes request to URL when an event happens. Consumer
sets up a server to listen for callbacks. Consumer registers callback URL with provider.
Provider makes request to URL when an event happens. Consumer
sets up a server to listen for callbacks. Consumer registers callback URL with provider.
None
Implementing Webhooks
url = get_callback_url() data = get_webhook_payload_json() try: resp = requests.post(url,
data=data) if not resp.ok: _logger.error(resp.content) except Exception as e: _logger.error(e)
Problem #1: Error Handling
> POST /callback < 400 Bad Request
> POST /callback < 302 Found < Location: http://
> POST /callback < 200 OK < Content-Type: text/plain <
<Response></Response>
Error Handling Suggestions
Be lenient in what you accept back if you can
reasonably guess. Retry failed callbacks with exponential back off. Decide if redirects are to be followed or not.
Be lenient in what you accept back if you can
reasonably guess. Retry failed callbacks with exponential back off. Decide if redirects are to be followed or not.
Be lenient in what you accept back if you can
reasonably guess. Retry failed callbacks with exponential back off. Decide if redirects are to be followed or not.
Problem #2: Flooding
None
Active Queues ↪ ↪
Problem #3: Security
> POST http://localhost:3000
> POST http://foo.lvh.me
DoS Attack Vector
Proving the Source
Validation Techniques
Key Sharing
Request Signing
Re-fetch > POST /callback > { id: 123 } >
GET /users/123 < { id: 123 } Webhook Callback App Code
Security Suggestions
Validate your requests. Document it well! Resolve IPs before making
request. Consider proxying. Consider subscription validation for high-volume cases.
Validate your requests. Document it well! Resolve IPs before making
request. Consider proxying. Consider subscription validation for high-volume cases.
Validate your requests. Document it well! Resolve IPs before making
request. Consider proxying. Consider subscription validation for high-volume cases.
Developer Experience
Payload Design
Fat vs.Thin
Mirror API Resources
Complete Documentation!
Tooling
Accept Multiple Callback URLs
Hooks API
Debugger & Logs
Manual Retries
Generate Test Callbacks
Tunneling Recommended: ngrok.com
Thank you! Questions?
[email protected]
Try Runscope free: runscope.com