RequestBin + Events API

RequestBin + Events API

100,000+ developers have used RequestBin.com to inspect webhooks, HTTP requests, and debug their applications. Recently, a user reached out wanting to retrieve the count and contents for their requests so they could automate their API testing. While that's not possible on RequestBin.com, you can solve that with an HTTP trigger and Node.js code step that uses $checkpoint and $respond() on Pipedream. Copy and run this workflow for free, or modify the Node.js if you want to customize the behavior:

https://pipedream.com/@pravin/requestbin-with-an-event-api-p_YyCBYY/edit

The max count of events to cache in $checkpoint (essentially a real-time data store) is set to 1000, but you can modify that in steps.process_event_data. To get started, copy and deploy the workflow to generate a unique endpoint URL. You can inspect events sent to this URL similar to RequestBin.

The instructions are in the readme step (which you can delete), but here is a summary of how the workflow works:

  • New requests will be saved to $checkpoint (the real-time data store for the workflow, which persists data across workflow executions)
  • Additionally, requests to your endpoint URL matching the path:
  • /api/events/count will return the count of events
  • /api/events/ will return the event details
  • /api/events/reset will delete the data stored in $checkpoint

Also, this logic is all in a Node.js code step, so you can see how it works and easily customize the code based on your needs using Javascript.

Similar to RequestBin, Pipedream makes it easy to get a unique HTTP URL and inspect events, but you can also:

  • Run code on each event using Node.js and npm
  • Auth apps and APIs with a click and use keys and oauth tokens in code (e.g., to send data to Google Sheets, Airtable or Slack)
  • Trigger your code via unique pipedream.net email addresses, custom schedules or integrate our SDK into your appPlus, there's no infrastructure to manage -- everything runs on Pipedream's servers!

You can also check out more workflow examples at https://pipedream.com/explore. If you have any feedback, please join our community at https://pipedream.com/community!