Peek Inside

Ring an audible bell everytime the team makes a sale.

View all of your Bells

You can view all your Bells on the one screen along with the Callback URL and when the bell last rang.

Adding a new Bell

Click on 'Add a bell' to get started. Input a Name and click 'Save changes' to generate the unique Callback URL.

Ring the Bell

Send a GET or POST request to the unique Callback URL everytime you make a sale and Ring the Bell to celebrate!

Basic Usage

Setup your first Bell

In this tutorial we will setup your first Bell.

  1. Click the 'Add a bell' button.
  2. Input My First Bell as the name and then 'Save changes'.
  3. A unique Callback URL will be generated that can be used to call the bell.
  4. Click on the 'View' button on the right hand side of your newly created bell to view all sales that come in.
  5. Find the unique Callback URL and Copy & Paste it into a new web browser tab leaving the 'View' tab still open.
  6. Quickly switch back to the 'View' tab to hear the bell ring and the fireworks display.

API Guide

All relative URLs in this document have the following base https://snja.io/1.0

Ring the Bell

POST /bells/ring/<UNIQUE_TOKEN>

The callback URL also accepts a HTTP Post request which allows you to pass additional Buyer & Seller information from the Sale.

This endpoint requires your API_KEY_ID and API_SECRET to access.

Request

Parameter Required Description Example
buyer.email NO STRING The buyer's Email Address penny.jones@example.com
buyer.full_name NO STRING The buyer's Full Name Penny Jones
buyer.address NO STRING The buyer's Address 1600 Pennsylvania Ave NW, Washington, DC 20500
buyer.phone NO STRING The buyer's Mobile Phone +15558675310
buyer.labels NO ARRAY Array of descriptive string labels ["$29/month", "Production"]
seller.email NO STRING The seller's Email Address john.smith@example.com
seller.full_name NO STRING The seller's Full Name John Smith
seller.phone NO STRING The seller's Mobile Phone +15558675310

Example of a request.

curl https://snja.io/1.0/bells/ring/<UNIQUE_TOKEN> \
    --header "X-Api-Id: <API_KEY_ID>" \
    --header "X-Api-Secret: <API_SECRET>" \
    --data "buyer[email]=<EMAIL>&buyer[full_name]=<FULL_NAME>&seller[full_name]=<FULL_NAME>"
$url = "https://snja.io/1.0/bells/ring/<UNIQUE_TOKEN>";
$headers = ["X-Api-Id: <API_KEY_ID>", "X-Api-Secret: <API_SECRET>"];
$data = [
    "buyer" => ["email" => "<EMAIL>", "full_name" => "<FULL_NAME>", "address" => "<ADDRESS>"],
    "seller" => ["full_name" => "<FULL_NAME>"],
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_exec($ch);

curl_close($ch);

Response

Example of a successful response.

{
    "response": {
        "error": 0,
        "message": "Woohoo! Congrats on making a sale!"
    }
}

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