PushingBox
Home Features API Help Login with Google

API Documentation

Send notifications from any device with a simple HTTP request.

HTTP API

Trigger a scenario by sending a GET or POST request to the API endpoint.

Endpoint

GET http://api.pushingbox.com/pushingbox?devid=YOUR_DEVID

POST http://api.pushingbox.com/pushingbox

Parameters

Parameter Required Description
devid Yes Your scenario DeviceID (16 characters)
[custom] No Any additional parameter will be used for variable substitution

Response Codes

Code Meaning
200Success
400Missing or invalid DeviceID
403Scenario is deactivated
429Daily quota exceeded

Custom Variables

You can use custom variables in your notification templates. Any parameter sent in your API request (except devid) will replace its corresponding $variable$ placeholder.

Example

# API call

GET /pushingbox?devid=vABC123&temperature=23&room=kitchen

# Template

The temperature in $room$ is $temperature$°C

# Result

The temperature in kitchen is 23°C

Email API

You can also trigger scenarios by sending an email.

# Email address format

api+YOUR_DEVID@api.pushingbox.com

The email subject and body can be used as variables ($subject$ and $body$).

Code Examples

Copy-paste ready examples for your favorite language or platform.

GET request

curl "http://api.pushingbox.com/pushingbox?devid=vABC123&temperature=23&room=kitchen"

POST request

curl -d "devid=vABC123&temperature=23&room=kitchen" http://api.pushingbox.com/pushingbox

Using requests (GET)

import requests

params = {
    "devid": "vABC123",
    "temperature": "23",
    "room": "kitchen"
}

response = requests.get("http://api.pushingbox.com/pushingbox", params=params)
print(response.text)

Using requests (POST)

import requests

data = {
    "devid": "vABC123",
    "temperature": "23",
    "room": "kitchen"
}

response = requests.post("http://api.pushingbox.com/pushingbox", data=data)
print(response.text)

Using cURL

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.pushingbox.com/pushingbox?devid=vABC123&temperature=23&room=kitchen");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

ESP8266 / ESP32 (WiFi)

#include <WiFi.h>
#include <HTTPClient.h>

const char* ssid = "YOUR_WIFI";
const char* password = "YOUR_PASSWORD";
const char* devid = "vABC123";

void sendNotification(String temperature, String room) {
    HTTPClient http;
    String url = "http://api.pushingbox.com/pushingbox?devid=";
    url += devid;
    url += "&temperature=" + temperature;
    url += "&room=" + room;

    http.begin(url);
    int httpCode = http.GET();
    http.end();
}

void setup() {
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) delay(500);
    sendNotification("23", "kitchen");
}

void loop() {}

Arduino Ethernet Shield

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "api.pushingbox.com";
EthernetClient client;

void setup() {
    Ethernet.begin(mac);
    delay(1000);

    if (client.connect(server, 80)) {
        client.println("GET /pushingbox?devid=vABC123&temperature=23 HTTP/1.1");
        client.println("Host: api.pushingbox.com");
        client.println("Connection: close");
        client.println();
    }
}

void loop() {}

Using fetch (browser)

const params = new URLSearchParams({
    devid: "vABC123",
    temperature: "23",
    room: "kitchen"
});

fetch(`http://api.pushingbox.com/pushingbox?${params}`)
    .then(response => response.text())
    .then(data => console.log(data));

Using built-in fetch (Node 18+)

const params = new URLSearchParams({
    devid: "vABC123",
    temperature: "23",
    room: "kitchen"
});

const response = await fetch(`http://api.pushingbox.com/pushingbox?${params}`);
console.log(await response.text());

Using http module (older Node.js)

const http = require("http");

const url = "http://api.pushingbox.com/pushingbox?devid=vABC123&temperature=23&room=kitchen";

http.get(url, (res) => {
    let data = "";
    res.on("data", chunk => data += chunk);
    res.on("end", () => console.log(data));
});

Limits

  • Daily quota: 100 requests/day
  • • Quota resets every day at midnight UTC