Peek Inside

Request Bins allow you capture and inspect HTTP requests in realtime for debugging & development. They are especially useful when developing code for webhooks on a local webserver.

View all of your Request Bins

You can view all your Request Bins on the one screen along with the bin's Name, Callback URL, number of Recieved Requests and the Last Called timestamp.

Adding a new Request Bin

Click on 'Add a request bin' to get started. Choose a Name and optionally a Replay URL (if you would like to forward the request to a local development machine at some point).

Inspecting the captured request

View your Request Bin and you'll see a log of everything recieved along with the Timestamp and HTTP method. If you specified a Replay URL you will see the Replay button here as well.

Basic Usage

Setup your first Request Bin

Lets say you are implementing some code that will recieve a delivery status webhook from a transactional email platform (Such as Mailgun, Mandrill, SendGrid).

  1. Create a new Request Bin and recieve an unique Callback URL.
  2. Input the Callback URL as the delivery status webhook endpoint on your transactional email platform.
  3. Now each time an email is sent through the platform the webhook will contact your Request Bin and you'll be able to inspect the format of this request, along with the headers and content body.

Replaying the request to your local machine

Request Bins will replay the request (including headers & content body) via Ajax. Using Ajax means you can correctly route the request simply by modifying your hosts file (like you would when setting up a virtual host on a local webserver such as XAMPP or Apache). Please note some headers are unable to be sent via Ajax and will be dropped/modfied instead.

  1. Edit your Request Bin (created in the above tutorial) to input a Replay URL and save the changes.
  2. View your Request Bin to see all the requests it has recieved along with the timestamp & HTTP method.
  3. Choose the request you would like to replay and click 'Replay'.
  4. The request along with allowable headers & content body will be forwarded to the Replay URL you nominated.
  5. The 'Replay' button will change color depending on the success of this action. You can use your browsers developer tools to trouble shoot.

API Overview

Authentication

You'll need to authenticate using your API Key.

There are two ways to authenticate:

Request Headers:

$ curl -H "X-Api-Id: <API_KEY_ID>" -H "X-Api-Secret: <API_SECRET>" 'https://snja.io'

URL Parameters:

$ curl 'https://snja.io/foo?_id=<API_KEY_ID>&_secret=<API_SECRET>'

API Keys

API Keys can be created and managed in the API Keys section.

  1. Go to the API Keys section.
  2. Click on the button 'Generate API Key'.
  3. A new key will be genereated for use with the API.

Rate Limits

API Keys are rate limited to ensure fair delivery of services. You can view the current Rate Limit and Remaining Requests in the returned Response Headers from the API. Below is a description of the Response Headers.

Header Description
X-RateLimit-Limit The maximum number of requests per time window.
X-RateLimit-Remaining The number of requests remaining before reset.
X-RateLimit-Reset The time at which the current rate limit window resets in UTC Epoch seconds.

Error Codes

The following HTTP response codes are used.

Code Message Description
200 OK The request has succeeded.
400 Bad Request The request could not be understood by the server due to malformed syntax.
401 Unauthorised This indicates that you have not passed a valid API key, the key has expired, or the Authorization header is not formatted correctly.
404 Not Found The server has not found anything matching the Request-URI.
405 Method Not Allowed This indicates that the request method is known by the server but has been disabled and cannot be used.
429 Too Many Requests We have recieved too many requests from your API Key in a given amount of time. Wait a while and try again.

More Products

Device Shots

Easily mock-up your app screenshots onto different devices for marketing

Ring the Bell

Login on a TV or Pi and ring an audible bell every time the team makes a sale

NPS Feedback

Your Net Promoter Score measures brand loyalty and forecasts business growth

Uptime Pings

Get notified instantly when your website is down and not responding to requests

Cron Monitoring

Get notified when your cron jobs fail or benchmark their performance

Status Page

Keep your customers informed during scheduled or unplanned outages

GEOIP to Country

Lookup Country, Language & Currency Information from an IP address

DNS Watcher

Track DNS changes on your domains & get notified of expiring certificates

Competitor Monitor

Monitor your competitors' websites and get notified when they change

Builder API

Cross-platform Hybrid App build service for Cordova, React Native & Flutter

Ninjalytics

Generate swimlane charts of your customer's journey through your product

Request Bins

Capture & inspect HTTP requests. Replay the request to your local machine