<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged api-testing</title>
<link>https://coderlegion.com/tag/api-testing</link>
<description>Powered by Question2Answer</description>
<item>
<title>Webhook Debugger, Logger &amp; API Mocker</title>
<link>https://coderlegion.com/9147/webhook-debugger-logger-api-mocker</link>
<description>&lt;hr&gt;
&lt;p&gt;I just shipped &lt;strong&gt;Webhook Debugger v2.7&lt;/strong&gt; – an open-source tool that generates temporary webhook URLs and logs every incoming request in real-time. No localhost tunneling, no complex setup, no ngrok required.&lt;/p&gt;
&lt;p&gt;If you've ever spent hours debugging why your Stripe payment webhook isn't working, this post is for you.&lt;/p&gt;
&lt;h3 id=&quot;what-problem-does-this-solve-&quot;&gt;What Problem Does This Solve?&lt;/h3&gt;
&lt;p&gt;Imagine this scenario: You're building an e-commerce checkout flow. Stripe sends a &lt;code&gt;payment_intent.succeeded&lt;/code&gt; webhook to your server, but your order confirmation email never sends.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The traditional debugging workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add &lt;code&gt;console.log&lt;/code&gt; statements everywhere&lt;/li&gt;
&lt;li&gt;Deploy to staging&lt;/li&gt;
&lt;li&gt;Make a test purchase&lt;/li&gt;
&lt;li&gt;Check server logs (nothing useful)&lt;/li&gt;
&lt;li&gt;Realize Stripe couldn't reach localhost&lt;/li&gt;
&lt;li&gt;Set up ngrok tunnel&lt;/li&gt;
&lt;li&gt;Update webhook URL in Stripe dashboard&lt;/li&gt;
&lt;li&gt;Repeat test purchase&lt;/li&gt;
&lt;li&gt;Still nothing...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This takes &lt;strong&gt;hours&lt;/strong&gt;. With Webhook Debugger, it takes &lt;strong&gt;30 seconds&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;how-it-works&quot;&gt;How It Works&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Start the Actor (one click on &lt;a rel=&quot;nofollow&quot; href=&quot;https://apify.com/ar27111994/webhook-debugger-logger&quot;&gt;Apify&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Get your webhook URLs instantly:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://&amp;lt;run-id&amp;gt;.runs.apify.net/webhook/wh_abc123
https://&amp;lt;run-id&amp;gt;.runs.apify.net/webhook/wh_def456
https://&amp;lt;run-id&amp;gt;.runs.apify.net/webhook/wh_ghi789
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Configure Stripe/GitHub/Shopify to send webhooks to these URLs&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; See every request in real-time:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;id&quot;: &quot;evt_8m2L5p9xR&quot;,
  &quot;timestamp&quot;: &quot;2025-12-28T12:00:00Z&quot;,
  &quot;webhookId&quot;: &quot;wh_abc123&quot;,
  &quot;method&quot;: &quot;POST&quot;,
  &quot;headers&quot;: {
    &quot;content-type&quot;: &quot;application/json&quot;,
    &quot;stripe-signature&quot;: &quot;t=123456789,v1=abc...&quot;
  },
  &quot;body&quot;: {
    &quot;type&quot;: &quot;payment_intent.succeeded&quot;,
    &quot;data&quot;: { &quot;amount&quot;: 9999 }
  },
  &quot;statusCode&quot;: 200,
  &quot;processingTime&quot;: 8
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you can see &lt;strong&gt;exactly&lt;/strong&gt; what Stripe is sending – the headers, the payload, everything.&lt;/p&gt;
&lt;h3 id=&quot;key-features-for-developers&quot;&gt;Key Features for Developers&lt;/h3&gt;
&lt;h4 id=&quot;real-time-streaming&quot;&gt;Real-Time Streaming&lt;/h4&gt;
&lt;p&gt;Monitor webhooks as they arrive using Server-Sent Events:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -N https://&amp;lt;actor-url&amp;gt;/log-stream
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every new webhook appears instantly in your terminal.&lt;/p&gt;
&lt;h4 id=&quot;api-mocking&quot;&gt;API Mocking&lt;/h4&gt;
&lt;p&gt;Simulate different response codes to test your error handling:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Simulate a 500 error
curl https://&amp;lt;actor-url&amp;gt;/webhook/wh_abc123?__status=500

# Simulate a 401 Unauthorized
curl https://&amp;lt;actor-url&amp;gt;/webhook/wh_abc123?__status=401
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;request-replay&quot;&gt;Request Replay&lt;/h4&gt;
&lt;p&gt;Captured a webhook but need to test it against your local server? Replay it:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl &quot;https://&amp;lt;actor-url&amp;gt;/replay/wh_abc123/evt_xyz?url=http://localhost:3000/webhook&quot; \
  -H &quot;Authorization: Bearer YOUR_KEY&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The original request is forwarded to your local endpoint with all original headers intact.&lt;/p&gt;
&lt;h4 id=&quot;custom-response-bodies&quot;&gt;Custom Response Bodies&lt;/h4&gt;
&lt;p&gt;Mock any API response:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;defaultResponseCode&quot;: 201,
  &quot;defaultResponseBody&quot;: &quot;{\&quot;status\&quot;: \&quot;created\&quot;, \&quot;orderId\&quot;: \&quot;ord_12345\&quot;}&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Perfect for testing how your system handles specific API responses.&lt;/p&gt;
&lt;h3 id=&quot;enterprise-security-features&quot;&gt;Enterprise Security Features&lt;/h3&gt;
&lt;p&gt;For production debugging, security matters:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Feature             &lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Key Auth&lt;/strong&gt;    &lt;/td&gt;&lt;td&gt;Require Bearer tokens for all requests&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;IP Whitelisting&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;Lock endpoints to specific IPs/CIDRs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Rate Limiting&lt;/strong&gt;   &lt;/td&gt;&lt;td&gt;Per-IP throttling on management endpoints&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Data Masking&lt;/strong&gt;    &lt;/td&gt;&lt;td&gt;Auto-redact Authorization headers from logs&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Example secure configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;authKey&quot;: &quot;my-secret-key-2025&quot;,
  &quot;allowedIps&quot;: [&quot;54.240.0.0/16&quot;],
  &quot;maskSensitiveData&quot;: true,
  &quot;rateLimitPerMinute&quot;: 30
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;what-s-new-in-v2-7-&quot;&gt;What's New in v2.7?&lt;/h3&gt;
&lt;p&gt;The latest release adds &lt;strong&gt;hot-reloading&lt;/strong&gt; – you can now update your configuration without restarting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change your &lt;code&gt;authKey&lt;/code&gt; → applies immediately&lt;/li&gt;
&lt;li&gt;Add more webhook URLs → generates instantly&lt;/li&gt;
&lt;li&gt;Update custom scripts → recompiles in real-time&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is critical during live debugging sessions where restarting would lose your captured data.&lt;/p&gt;
&lt;h3 id=&quot;real-world-use-cases&quot;&gt;Real-World Use Cases&lt;/h3&gt;
&lt;h4 id=&quot;stripe-payment-debugging&quot;&gt;Stripe Payment Debugging&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;forwardUrl&quot;: &quot;http://localhost:3000/stripe-webhook&quot;,
  &quot;jsonSchema&quot;: {
    &quot;type&quot;: &quot;object&quot;,
    &quot;required&quot;: [&quot;type&quot;, &quot;data&quot;],
    &quot;properties&quot;: {
      &quot;type&quot;: { &quot;type&quot;: &quot;string&quot; }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Validates Stripe payloads and forwards them to your local server simultaneously.&lt;/p&gt;
&lt;h4 id=&quot;github-actions-recovery&quot;&gt;GitHub Actions Recovery&lt;/h4&gt;
&lt;p&gt;Missed a critical deployment webhook? Replay it:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Find the missed event
curl &quot;https://&amp;lt;actor-url&amp;gt;/logs?method=POST&amp;amp;limit=10&quot; \
  -H &quot;Authorization: Bearer YOUR_KEY&quot;

# Replay to your CI system
curl &quot;https://&amp;lt;actor-url&amp;gt;/replay/wh_abc123/evt_missed?url=https://ci.internal/deploy&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;shopify-flow-testing&quot;&gt;Shopify Flow Testing&lt;/h4&gt;
&lt;p&gt;Use custom scripts to transform webhooks before logging:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;// Parse nested JSON and add debug flags
if (event.contentType === &quot;application/json&quot;) {
  const body = JSON.parse(event.body);
  event.body = {
    ...body,
    _debugMode: true,
    _receivedAt: Date.now(),
  };
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;getting-started-in-60-seconds&quot;&gt;Getting Started in 60 Seconds&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;a rel=&quot;nofollow&quot; href=&quot;https://apify.com/ar27111994/webhook-debugger-logger&quot;&gt;Webhook Debugger on Apify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Start&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Copy your webhook URLs from the output&lt;/li&gt;
&lt;li&gt;Configure your service to send to those URLs&lt;/li&gt;
&lt;li&gt;Watch requests arrive in the Dataset tab&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That's it. No installation, no configuration files, no tunnels.&lt;/p&gt;
&lt;h3 id=&quot;faq&quot;&gt;FAQ&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Q: How long are URLs valid?&lt;/strong&gt;&lt;br&gt;
A: Default is 24 hours, configurable up to 72 hours.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: Is my data stored?&lt;/strong&gt;&lt;br&gt;
A: Only in your personal Apify dataset. You own it, it's automatically deleted after retention expires.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: What's the payload limit?&lt;/strong&gt;&lt;br&gt;
A: 10MB default, configurable up to 100MB.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Q: Can I use this with Zapier?&lt;/strong&gt;&lt;br&gt;
A: Yes! Use the forwarding feature to pipe webhooks to your Zap's catch URL.&lt;/p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Webhook Debugger&lt;/strong&gt; solves a real problem that every developer faces: debugging invisible HTTP requests. Instead of guessing what went wrong, you get &lt;strong&gt;complete visibility&lt;/strong&gt; into every request.&lt;/p&gt;
&lt;p&gt;The key features that make this tool production-ready are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Real-time SSE streaming&lt;/strong&gt; for instant visibility&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Request replay&lt;/strong&gt; for testing and recovery&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enterprise security&lt;/strong&gt; with auth, IP whitelisting, and rate limiting&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hot-reloading&lt;/strong&gt; for zero-downtime configuration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom scripting&lt;/strong&gt; for payload transformation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The project is &lt;strong&gt;open-source&lt;/strong&gt; on &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/ar27111994/webhook-debugger-logger&quot;&gt;GitHub&lt;/a&gt;, and you can try it immediately on the &lt;a rel=&quot;nofollow&quot; href=&quot;https://apify.com/ar27111994/webhook-debugger-logger&quot;&gt;Apify Store&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Stop debugging blindly. Start seeing your webhooks. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Questions or feature requests? Open an issue on &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/ar27111994/webhook-debugger-logger/issues&quot;&gt;GitHub&lt;/a&gt; or reach out in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://discord.gg/jyEM2PRvMU&quot;&gt;Apify Discord&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Dev Tools</category>
<guid isPermaLink="true">https://coderlegion.com/9147/webhook-debugger-logger-api-mocker</guid>
<pubDate>Wed, 31 Dec 2025 21:56:44 +0000</pubDate>
</item>
</channel>
</rss>