Statping

General notes

The Statping API allows you to programmatically access data on your Statping server.

The easiest way to get started with the API is by running your own Docker or local instance of the Statping server.

Authentication

An API Key is required to be sent as part of every request to the Statping API, by using the Authorization and the API Secret Key as a header.

If you do not have an API Secret Key, you can find it on the Settings page.

You can Authenticate by implementing the following… - Using the Authorization header with API Secret Key - Setting GO_ENV to test to bypass all authentication - Adding ?api=<keyhere> URL Query along with the API Secret Key - Being logged into Statping as an admin (using JWT sessions/cookies)

Authentication will create a cookie named statping_auth.

Environment Variables

Statping includes many environment variables that can give you more control over your instance. Please view the Environment Variables Wiki page to view a complete list. Below are a couple important ones… - STATPING_DIR - Statping’s working directory. By default, this will be set to the current working directory. This path will contain the config.yml file, logs, and assets folder. - SASS - Absolute path to the sass executable. By default it will attempt to find sass in your $PATH.

Demo

You can checkout the Statping Demo instance at https://demo.statping.com. All features are available for you to experiment with. The API Secret Key is demoapisecret123. Since this instance is public, it will be reset with sample data every 90 minutes.

API detail

Setup

If your Statping instance is not setup yet, then you can set it up by going to http://localhost:8080/setup or by using this API endpoint. Once your instance has already been setup successfully, this endpoint will return an error.

Statping Setup

This endpoint will setup the database, users, sample data, and all other elements for a brand new installation of Statping. By default, the admin login is admin admin, if you don’t include a username/password.

If the server has already been setup, this endpoint will return an error.
{
    "error": "Statping has already been setup"
}

Database Fields

  • db_connection - Database connection type. (sqlite, mysql, postgres)
  • db_user - Username for database
  • db_password - Password for database
  • db_database - Database name for Statping
  • db_port - Port number for the database
  • db_host - Hostname or IP for the running database server
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -d "db_host=localhost&db_user=root&db_password=password123&db_database=statping&db_connection=mysql&db_port=3306&project=Statping Monitoring Sample Data&description=View All Example Services&username=admin&password=admin&domain=http://localhost:8080&email=info@domain.com&sample_data=true" "http://0.0.0.0:8585/api/setup"
POST /api/setup HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/x-www-form-urlencoded
Content-Type: application/x-www-form-urlencoded

db_host=localhost&db_user=root&db_password=password123&db_database=statping&db_connection=mysql&db_port=3306&project=Statping Monitoring Sample Data&description=View All Example Services&username=admin&password=admin&domain=http://localhost:8080&email=info@domain.com&sample_data=true

Miscellaneous

This is for Statping’s miscellaneous API endpoints that aren’t a part of another category.

Statping Details

The root API endpoint to view basic Statping configuration including Name, URL, database type, and other useful fields.

curl -X GET "http://0.0.0.0:8585/api"
GET /api HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length398
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:09 GMT
{
    "admin": false,
    "allow_reports": false,
    "created_at": "2020-05-02T01:00:07.885973685Z",
    "description": "This data is only used to testing",
    "domain": "http://localhost:8080",
    "footer": null,
    "logged_in": false,
    "migration_id": 1588381207,
    "name": "Statping Sample Data",
    "setup": true,
    "started_on": "2020-05-02T01:00:14.255837864Z",
    "updated_at": "2020-05-02T01:00:12.731269305Z",
    "using_cdn": false,
    "version": "0.90.34"
}

Logs

This endpoint will return a list of the last 1,000 logs.

curl -X GET "http://0.0.0.0:8585/api/logs"
GET /api/logs HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length398
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:09 GMT
{
    "admin": false,
    "allow_reports": false,
    "created_at": "2020-05-02T01:00:07.885973685Z",
    "description": "This data is only used to testing",
    "domain": "http://localhost:8080",
    "footer": null,
    "logged_in": false,
    "migration_id": 1588381207,
    "name": "Statping Sample Data",
    "setup": true,
    "started_on": "2020-05-02T01:00:14.255837864Z",
    "updated_at": "2020-05-02T01:00:12.731269305Z",
    "using_cdn": false,
    "version": "0.90.34"
}

Logs Last Line

This endpoint will return the last line in the logs.

curl -X GET "http://0.0.0.0:8585/api/logs"
GET /api/logs HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length398
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:09 GMT
{
    "admin": false,
    "allow_reports": false,
    "created_at": "2020-05-02T01:00:07.885973685Z",
    "description": "This data is only used to testing",
    "domain": "http://localhost:8080",
    "footer": null,
    "logged_in": false,
    "migration_id": 1588381207,
    "name": "Statping Sample Data",
    "setup": true,
    "started_on": "2020-05-02T01:00:14.255837864Z",
    "updated_at": "2020-05-02T01:00:12.731269305Z",
    "using_cdn": false,
    "version": "0.90.34"
}

Health Check

Check the status of your Statping instance. If everything is healthy, it will return a status code of 200 with the following JSON response.

curl -X GET "http://0.0.0.0:8585/health"
GET /health HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length42
Content-Typeapplication/json
DateSat, 02 May 2020 01:03:29 GMT
{
    "online": true,
    "services": 6,
    "setup": true
}

Prometheus Metrics

Point your Prometheus endpoint to /metrics, it will include most data from all elements including golang processes. View more information by checking out the Prometheus Wiki.

curl -X GET "http://0.0.0.0:8585/metrics"
GET /metrics HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typetext/plain; charset=utf-8
DateSat, 02 May 2020 01:05:53 GMT
Transfer-Encodingchunked

Clear Cache

This endpoint will clear all the cache files in your Statping instance. This includes chart data and service views.

curl -X GET "http://0.0.0.0:8585/api/clear_cache"
GET /api/clear_cache HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length21
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:43 GMT
{
    "status": "success"
}

List Cache

This endpoint will return all cached API endpoints.

curl -X GET "http://0.0.0.0:8585/api/cache"
GET /api/cache HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length1631
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:32 GMT
[
    {
        "url": "/api/services/1/failure_data?start=1585789587&end=1588381587&group=24h&fill=true",
        "expiration": "2020-05-02T01:06:57.511702322Z",
        "size": 1541
    },
    {
        "url": "/api/services/1/hits_data?start=1588127787&end=1588381587&group=5m&fill=false",
        "expiration": "2020-05-02T01:06:57.808458203Z",
        "size": 45223
    },
    {
        "url": "/api/services/2/hits_data?start=1588127787&end=1588381587&group=5m&fill=false",
        "expiration": "2020-05-02T01:06:57.873815975Z",
        "size": 45224
    },
    {
        "url": "/api/services/3/hits_data?start=1588127787&end=1588381587&group=5m&fill=false",
        "expiration": "2020-05-02T01:06:57.909984136Z",
        "size": 45088
    },
    {
        "url": "/api/services/2/failure_data?start=1585789587&end=1588381587&group=24h&fill=true",
        "expiration": "2020-05-02T01:06:57.48592429Z",
        "size": 1538
    },
    {
        "url": "/api/services/4/failure_data?start=1585789587&end=1588381587&group=24h&fill=true",
        "expiration": "2020-05-02T01:06:57.493425593Z",
        "size": 1538
    },
    {
        "url": "/api/services/3/failure_data?start=1585789587&end=1588381587&group=24h&fill=true",
        "expiration": "2020-05-02T01:06:57.493554858Z",
        "size": 1538
    },
    {
        "url": "/api/services/5/failure_data?start=1585789587&end=1588381587&group=24h&fill=true",
        "expiration": "2020-05-02T01:06:57.511424891Z",
        "size": 1538
    },
    {
        "url": "/api/services/5/hits_data?start=1588127788&end=1588381588&group=5m&fill=false",
        "expiration": "2020-05-02T01:06:58.377413844Z",
        "size": 45193
    },
    {
        "url": "/api/services/4/hits_data?start=1588127788&end=1588381588&group=5m&fill=false",
        "expiration": "2020-05-02T01:06:58.380229692Z",
        "size": 45198
    }
]

Shields.io Badge

You can create custom badges with dynamic information by using Shields.io and parsing JSON fields with JSONPath.

Examples

Service Uptime Percent

  • URL: https://demo.statping.com/api/services/2
  • JSON Path: $.online_24_hours
  • Suffix: %

    https://img.shields.io/badge/dynamic/json?color=blue&label=%20Statping%20Uptime&query=%24.online_24_hours&url=https%3A%2F%2Fdemo.statping.com%2Fapi%2Fservices%2F2&suffix=%
    

Count Services

  • URL: https://demo.statping.com/health
  • JSON Path: $.services
  • Suffix: services

    https://img.shields.io/badge/dynamic/json?color=purple&label=Demo%20Site&query=%24.services&url=https://demo.statping.com/health&suffix=%20services
    
curl -X GET "https://img.shields.io/badge/dynamic/json?color=blue&label=Statping Uptime 24/hr&query=$.online_24_hours&url=https://demo.statping.com/api/services/1&suffix=%"
GET /badge/dynamic/json?color=blue&label=Statping Uptime 24/hr&query=$.online_24_hours&url=https://demo.statping.com/api/services/1&suffix=% HTTP/1.1
Host: img.shields.io

Services

With the Statping API, you can add, remove, edit all your services fields from the API directly. This includes viewing Service chart data for latency/up-time, and even viewing a log of failures.

All Services

View an array of all Services added to your Statping instance.

curl -X GET "http://0.0.0.0:8585/api/services"
GET /api/services HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateSat, 02 May 2020 01:07:00 GMT
Transfer-Encodingchunked
[
    {
        "avg_response": 1234129,
        "check_interval": 10,
        "created_at": "2020-02-02T01:00:08.103271859Z",
        "failures_24_hours": 321,
        "group_id": 1,
        "id": 1,
        "last_error": "2020-05-08T18:20:08.881632603Z",
        "last_success": "2020-05-02T01:06:54.035553551Z",
        "latency": 119927,
        "name": "Google",
        "online": true,
        "online_24_hours": 95.35,
        "online_7_days": 95.35,
        "order_id": 1,
        "permalink": "google",
        "ping_time": 11034,
        "public": true,
        "stats": {
            "failures": 404,
            "hits": 8683,
            "first_hit": "2020-04-29T01:00:10.245169916Z"
        },
        "status_code": 200,
        "updated_at": "2020-05-02T01:00:08.103367884Z"
    },
    {
        "avg_response": 1158576,
        "check_interval": 30,
        "created_at": "2020-02-02T01:00:08.103271859Z",
        "failures_24_hours": 408,
        "group_id": 0,
        "id": 2,
        "last_error": "2020-05-02T01:06:44.254597647Z",
        "last_success": "2020-05-02T01:06:14.289921794Z",
        "latency": 88378,
        "name": "Statping Github",
        "online": false,
        "online_24_hours": 95.28,
        "online_7_days": 95.28,
        "order_id": 2,
        "permalink": "statping_github",
        "ping_time": 11554,
        "public": true,
        "stats": {
            "failures": 408,
            "hits": 8651,
            "first_hit": "2020-04-29T01:00:10.587232314Z"
        },
        "status_code": 406,
        "updated_at": "2020-05-02T01:00:08.161946425Z"
    },
    {
        "avg_response": 977729,
        "check_interval": 60,
        "created_at": "2020-02-02T01:00:08.103271859Z",
        "failures_24_hours": 403,
        "group_id": 2,
        "id": 3,
        "last_error": "2020-05-28T06:10:08.881632603Z",
        "last_success": "2020-05-02T01:06:14.457520734Z",
        "latency": 41615,
        "name": "JSON Users Test",
        "online": true,
        "online_24_hours": 95.34,
        "online_7_days": 95.34,
        "order_id": 3,
        "permalink": null,
        "ping_time": 11150,
        "public": true,
        "stats": {
            "failures": 403,
            "hits": 8649,
            "first_hit": "2020-04-29T01:00:10.929333549Z"
        },
        "status_code": 200,
        "updated_at": "2020-05-02T01:00:08.212206993Z"
    },
    {
        "avg_response": 1301894,
        "check_interval": 30,
        "created_at": "2020-02-02T01:00:08.103271859Z",
        "failures_24_hours": 403,
        "group_id": 2,
        "id": 4,
        "last_error": "2020-06-07T00:05:08.881632603Z",
        "last_success": "2020-05-02T01:06:45.53496799Z",
        "latency": 869091,
        "name": "JSON API Tester",
        "online": true,
        "online_24_hours": 95.34,
        "online_7_days": 95.34,
        "order_id": 4,
        "permalink": null,
        "ping_time": 10980,
        "public": true,
        "stats": {
            "failures": 403,
            "hits": 8656,
            "first_hit": "2020-04-29T01:00:11.279703666Z"
        },
        "status_code": 201,
        "updated_at": "2020-05-02T01:00:08.270923495Z"
    },
    {
        "avg_response": 1182385,
        "check_interval": 20,
        "created_at": "2020-02-02T01:00:08.103271859Z",
        "failures_24_hours": 0,
        "group_id": 1,
        "id": 5,
        "last_error": "0001-01-01T00:00:00Z",
        "last_success": "2020-05-02T01:06:54.905566976Z",
        "latency": 591,
        "name": "Google DNS",
        "online": true,
        "online_24_hours": 100,
        "online_7_days": 100,
        "order_id": 5,
        "permalink": null,
        "ping_time": 5,
        "public": true,
        "stats": {
            "failures": 0,
            "hits": 8663,
            "first_hit": "2020-04-29T01:00:11.689163285Z"
        },
        "status_code": 0,
        "updated_at": "2020-05-02T01:00:08.337836008Z"
    }
]

View Service

View a specific service, this will include the service’s failures and checkins.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1"
GET /api/services/1 HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Content-Length534
Content-Typeapplication/json
DateSat, 02 May 2020 01:07:16 GMT
{
    "avg_response": 1233870,
    "check_interval": 10,
    "created_at": "2020-02-02T01:00:08.103271859Z",
    "failures_24_hours": 321,
    "group_id": 1,
    "id": 1,
    "last_error": "2020-05-08T18:20:08.881632603Z",
    "last_success": "2020-05-02T01:07:14.027666715Z",
    "latency": 111427,
    "name": "Google",
    "online": true,
    "online_24_hours": 95.35,
    "online_7_days": 95.35,
    "order_id": 1,
    "permalink": "google",
    "ping_time": 11580,
    "public": true,
    "stats": {
        "failures": 404,
        "hits": 8685,
        "first_hit": "2020-04-29T01:00:10.245169916Z"
    },
    "status_code": 200,
    "updated_at": "2020-05-02T01:00:08.103367884Z"
}

View Service Chart Data

View the chart data for the service’s latency. The response returns an array of objects as timeframe for timestamp, and amount for value in ascending order.

Grouping Data

You can group the chart data by using the group parameter. For example, if you want to group hits in 12 hours, you could use 12h. You can also group by minutes like 15m for 15 minutes.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1/hits_data?start={{start_time}}&end={{end_time}}&group=1h"
GET /api/services/1/hits_data?start={{start_time}}&end={{end_time}}&group=1h HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Access-Control-Allow-Origin*
Content-Typeapplication/json
DateFri, 01 May 2020 23:35:21 GMT
Transfer-Encodingchunked
[
    {
        "timeframe": "2020-04-28T23:00:00Z",
        "amount": 2821357
    },
    {
        "timeframe": "2020-04-29T00:00:00Z",
        "amount": 3948440
    },
    {
        "timeframe": "2020-04-29T01:00:00Z",
        "amount": 2561839
    },
    {
        "timeframe": "2020-04-29T02:00:00Z",
        "amount": 298890
    },
    {
        "timeframe": "2020-04-29T03:00:00Z",
        "amount": 595086
    },
    {
        "timeframe": "2020-04-29T04:00:00Z",
        "amount": 3353651
    },
    {
        "timeframe": "2020-04-29T05:00:00Z",
        "amount": 3816639
    },
    {
        "timeframe": "2020-04-29T06:00:00Z",
        "amount": 2479045
    },
    {
        "timeframe": "2020-04-29T07:00:00Z",
        "amount": 730765
    },
    {
        "timeframe": "2020-04-29T08:00:00Z",
        "amount": 742941
    },
    {
        "timeframe": "2020-04-29T09:00:00Z",
        "amount": 299063
    },
    {
        "timeframe": "2020-04-29T10:00:00Z",
        "amount": 136331
    },
    {
        "timeframe": "2020-04-29T11:00:00Z",
        "amount": 319792
    },
    {
        "timeframe": "2020-04-29T12:00:00Z",
        "amount": 1146633
    },
    {
        "timeframe": "2020-04-29T13:00:00Z",
        "amount": 186369
    },
    {
        "timeframe": "2020-04-29T14:00:00Z",
        "amount": 751189
    },
    {
        "timeframe": "2020-04-29T15:00:00Z",
        "amount": 299781
    },
    {
        "timeframe": "2020-04-29T16:00:00Z",
        "amount": 725325
    },
    {
        "timeframe": "2020-04-29T17:00:00Z",
        "amount": 786672
    },
    {
        "timeframe": "2020-04-29T18:00:00Z",
        "amount": 809931
    },
    {
        "timeframe": "2020-04-29T19:00:00Z",
        "amount": 758894
    },
    {
        "timeframe": "2020-04-29T20:00:00Z",
        "amount": 1612743
    },
    {
        "timeframe": "2020-04-29T21:00:00Z",
        "amount": 1918771
    },
    {
        "timeframe": "2020-04-29T22:00:00Z",
        "amount": 1959122
    },
    {
        "timeframe": "2020-04-29T23:00:00Z",
        "amount": 703709
    },
    {
        "timeframe": "2020-04-30T00:00:00Z",
        "amount": 348894
    },
    {
        "timeframe": "2020-04-30T01:00:00Z",
        "amount": 247846
    },
    {
        "timeframe": "2020-04-30T02:00:00Z",
        "amount": 876778
    },
    {
        "timeframe": "2020-04-30T03:00:00Z",
        "amount": 516935
    },
    {
        "timeframe": "2020-04-30T04:00:00Z",
        "amount": 148509
    },
    {
        "timeframe": "2020-04-30T05:00:00Z",
        "amount": 248569
    },
    {
        "timeframe": "2020-04-30T06:00:00Z",
        "amount": 177620
    },
    {
        "timeframe": "2020-04-30T07:00:00Z",
        "amount": 670146
    },
    {
        "timeframe": "2020-04-30T08:00:00Z",
        "amount": 168823
    },
    {
        "timeframe": "2020-04-30T09:00:00Z",
        "amount": 756748
    },
    {
        "timeframe": "2020-04-30T10:00:00Z",
        "amount": 730129
    },
    {
        "timeframe": "2020-04-30T11:00:00Z",
        "amount": 389544
    },
    {
        "timeframe": "2020-04-30T12:00:00Z",
        "amount": 133279
    },
    {
        "timeframe": "2020-04-30T13:00:00Z",
        "amount": 1257221
    },
    {
        "timeframe": "2020-04-30T14:00:00Z",
        "amount": 1095851
    },
    {
        "timeframe": "2020-04-30T15:00:00Z",
        "amount": 1086126
    },
    {
        "timeframe": "2020-04-30T16:00:00Z",
        "amount": 532353
    },
    {
        "timeframe": "2020-04-30T17:00:00Z",
        "amount": 1321025
    },
    {
        "timeframe": "2020-04-30T18:00:00Z",
        "amount": 498795
    },
    {
        "timeframe": "2020-04-30T19:00:00Z",
        "amount": 1334088
    },
    {
        "timeframe": "2020-04-30T20:00:00Z",
        "amount": 670188
    },
    {
        "timeframe": "2020-04-30T21:00:00Z",
        "amount": 157049
    },
    {
        "timeframe": "2020-04-30T22:00:00Z",
        "amount": 501978
    },
    {
        "timeframe": "2020-04-30T23:00:00Z",
        "amount": 490371
    },
    {
        "timeframe": "2020-05-01T00:00:00Z",
        "amount": 459638
    },
    {
        "timeframe": "2020-05-01T01:00:00Z",
        "amount": 435766
    },
    {
        "timeframe": "2020-05-01T02:00:00Z",
        "amount": 1019118
    },
    {
        "timeframe": "2020-05-01T03:00:00Z",
        "amount": 473220
    },
    {
        "timeframe": "2020-05-01T04:00:00Z",
        "amount": 773802
    },
    {
        "timeframe": "2020-05-01T05:00:00Z",
        "amount": 169785
    },
    {
        "timeframe": "2020-05-01T06:00:00Z",
        "amount": 161522
    },
    {
        "timeframe": "2020-05-01T07:00:00Z",
        "amount": 2188049
    },
    {
        "timeframe": "2020-05-01T08:00:00Z",
        "amount": 1953334
    },
    {
        "timeframe": "2020-05-01T09:00:00Z",
        "amount": 464254
    },
    {
        "timeframe": "2020-05-01T10:00:00Z",
        "amount": 1122877
    },
    {
        "timeframe": "2020-05-01T11:00:00Z",
        "amount": 1451397
    },
    {
        "timeframe": "2020-05-01T12:00:00Z",
        "amount": 880588
    },
    {
        "timeframe": "2020-05-01T13:00:00Z",
        "amount": 302396
    },
    {
        "timeframe": "2020-05-01T14:00:00Z",
        "amount": 239921
    },
    {
        "timeframe": "2020-05-01T15:00:00Z",
        "amount": 891828
    },
    {
        "timeframe": "2020-05-01T16:00:00Z",
        "amount": 999550
    },
    {
        "timeframe": "2020-05-01T17:00:00Z",
        "amount": 566471
    },
    {
        "timeframe": "2020-05-01T18:00:00Z",
        "amount": 399267
    },
    {
        "timeframe": "2020-05-01T19:00:00Z",
        "amount": 348657
    },
    {
        "timeframe": "2020-05-01T20:00:00Z",
        "amount": 202352
    },
    {
        "timeframe": "2020-05-01T21:00:00Z",
        "amount": 703166
    },
    {
        "timeframe": "2020-05-01T22:00:00Z",
        "amount": 1713541
    },
    {
        "timeframe": "2020-05-01T23:00:00Z",
        "amount": 125889
    }
]

View Service Ping Data

View the chart data for the service’s ping response time. The response returns an array of objects as timeframe for timestamp, and amount for value in ascending order.

Grouping Data

You can group the chart data by using the group parameter. For example, if you want to group hits in 12 hours, you could use 12h. You can also group by minutes like 15m for 15 minutes.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1/ping_data?start={{start_time}}&end={{end_time}}&group=12h"
GET /api/services/1/ping_data?start={{start_time}}&end={{end_time}}&group=12h HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Access-Control-Allow-Origin*
Content-Length374
Content-Typeapplication/json
DateFri, 01 May 2020 23:36:34 GMT
[
    {
        "timeframe": "2020-04-28T12:00:00Z",
        "amount": 1410678
    },
    {
        "timeframe": "2020-04-29T00:00:00Z",
        "amount": 803436
    },
    {
        "timeframe": "2020-04-29T12:00:00Z",
        "amount": 485797
    },
    {
        "timeframe": "2020-04-30T00:00:00Z",
        "amount": 220022
    },
    {
        "timeframe": "2020-04-30T12:00:00Z",
        "amount": 378263
    },
    {
        "timeframe": "2020-05-01T00:00:00Z",
        "amount": 444698
    },
    {
        "timeframe": "2020-05-01T12:00:00Z",
        "amount": 285061
    }
]

View Service Failure Data

View the data service failures in a heatmap. The response returns an array of objects as timeframe for timestamp, and amount for value in ascending order.

Grouping Data

You can group the chart data by using the group parameter. For example, if you want to group hits in 12 hours, you could use 12h. You can also group by minutes like 15m for 15 minutes.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1/failure_data?start={{start_time}}&end={{end_time}}&group=12h"
GET /api/services/1/failure_data?start={{start_time}}&end={{end_time}}&group=12h HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Access-Control-Allow-Origin*
Content-Length344
Content-Typeapplication/json
DateFri, 01 May 2020 23:39:38 GMT
[
    {
        "timeframe": "2020-04-28T12:00:00Z",
        "amount": 2
    },
    {
        "timeframe": "2020-04-29T00:00:00Z",
        "amount": 21
    },
    {
        "timeframe": "2020-04-29T12:00:00Z",
        "amount": 20
    },
    {
        "timeframe": "2020-04-30T00:00:00Z",
        "amount": 21
    },
    {
        "timeframe": "2020-04-30T12:00:00Z",
        "amount": 20
    },
    {
        "timeframe": "2020-05-01T00:00:00Z",
        "amount": 21
    },
    {
        "timeframe": "2020-05-01T12:00:00Z",
        "amount": 29
    }
]

View Service Failures

Returns an array of failures for this service. It includes the error message, http status code, and the ping response time.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1/failures?start={{start_time}}&end={{end_time}}"
GET /api/services/1/failures?start={{start_time}}&end={{end_time}} HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

View Service Hits

Returns on array of all the successful hits for this service.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1/hits?start={{start_time}}&end={{end_time}}"
GET /api/services/1/hits?start={{start_time}}&end={{end_time}} HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

Reorder Services

Reorder services in a specific order for the index page.

curl -X POST -H "Content-Type: application/json" -d '[{"service":1,"order":1},{"service":2,"order":3},{"service":3,"order":4},{"service":4,"order":5}]' "http://0.0.0.0:8585/api/reorder/services"
POST /api/reorder/services HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

[{"service":1,"order":1},{"service":2,"order":3},{"service":3,"order":4},{"service":4,"order":5}]
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:31:40 GMT
Content-Length122
[
    {
        "service": 1,
        "order": 1
    },
    {
        "service": 5,
        "order": 2
    },
    {
        "service": 2,
        "order": 3
    },
    {
        "service": 3,
        "order": 4
    },
    {
        "service": 4,
        "order": 5
    }
]

Create Service

Create a new service and begin monitoring.

curl -X POST -H "Content-Type: application/json" -d '{
    "name": "New Service",
    "domain": "https://statping.com",
    "expected": "",
    "expected_status": 200,
    "check_interval": 30,
    "type": "http",
    "method": "GET",
    "post_data": "",
    "port": 0,
    "timeout": 30,
    "order_id": 0
}' "http://0.0.0.0:8585/api/services"
POST /api/services HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "name": "New Service",
    "domain": "https://statping.com",
    "expected": "",
    "expected_status": 200,
    "check_interval": 30,
    "type": "http",
    "method": "GET",
    "post_data": "",
    "port": 0,
    "timeout": 30,
    "order_id": 0
}
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:31:47 GMT
Content-Length528
{
    "status": "success",
    "type": "service",
    "method": "create",
    "id": 10,
    "output": {
        "id": 10,
        "name": "New Service",
        "domain": "https://statping.com",
        "expected": "",
        "expected_status": 200,
        "check_interval": 30,
        "type": "http",
        "method": "GET",
        "post_data": "",
        "port": 0,
        "timeout": 30,
        "order_id": 0,
        "allow_notifications": false,
        "created_at": "2018-12-10T11:31:47.535086-08:00",
        "updated_at": "2018-12-10T11:31:47.535184-08:00",
        "online": false,
        "latency": 0,
        "ping_time": 0,
        "online_24_hours": 0,
        "avg_response": "",
        "status_code": 0,
        "last_success": "0001-01-01T00:00:00Z"
    }
}

Update Service

Update a service with new values and begin monitoring.

curl -X POST -H "Content-Type: application/json" -d '{
    "name": "Brand New Service",
    "domain": "https://google.net",
    "expected": "heyyyy",
    "expected_status": 200,
    "check_interval": 20,
    "type": "http",
    "method": "GET",
    "post_data": "",
    "port": 0,
    "timeout": 10,
    "order_id": 0
}' "http://0.0.0.0:8585/api/services/{{service_id}}"
POST /api/services/%7B%7Bservice_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "name": "Brand New Service",
    "domain": "https://google.net",
    "expected": "heyyyy",
    "expected_status": 200,
    "check_interval": 20,
    "type": "http",
    "method": "GET",
    "post_data": "",
    "port": 0,
    "timeout": 10,
    "order_id": 0
}
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:31:54 GMT
Content-Length567
{
    "status": "success",
    "type": "service",
    "method": "update",
    "id": 10,
    "output": {
        "id": 10,
        "name": "Updated New Service",
        "domain": "https://google.com",
        "expected": "",
        "expected_status": 200,
        "check_interval": 60,
        "type": "http",
        "method": "GET",
        "post_data": "",
        "port": 0,
        "timeout": 10,
        "order_id": 0,
        "allow_notifications": false,
        "created_at": "2018-12-10T11:31:47.535086-08:00",
        "updated_at": "2018-12-10T11:31:47.535184-08:00",
        "online": true,
        "latency": 0.550636193,
        "ping_time": 0.073339805,
        "online_24_hours": 0,
        "avg_response": "",
        "status_code": 200,
        "last_success": "2018-12-10T11:31:49.161389-08:00"
    }
}

Delete Service Failures

Delete all the service failures.

curl -X DELETE "http://0.0.0.0:8585/api/services/{{service_id}}/failures"
DELETE /api/services/%7B%7Bservice_id%7D%7D/failures HTTP/1.1
Host: 0.0.0.0:8585

Delete Service

Delete a service and stops monitoring.

curl -X DELETE "http://0.0.0.0:8585/api/services/{{service_id}}"
DELETE /api/services/%7B%7Bservice_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:32:06 GMT
Content-Length567
{
    "status": "success",
    "type": "service",
    "method": "delete",
    "id": 10,
    "output": {
        "id": 10,
        "name": "Updated New Service",
        "domain": "https://google.com",
        "expected": "",
        "expected_status": 200,
        "check_interval": 60,
        "type": "http",
        "method": "GET",
        "post_data": "",
        "port": 0,
        "timeout": 10,
        "order_id": 0,
        "allow_notifications": false,
        "created_at": "2018-12-10T11:31:47.535086-08:00",
        "updated_at": "2018-12-10T11:31:47.535184-08:00",
        "online": true,
        "latency": 0.203382878,
        "ping_time": 0.001664491,
        "online_24_hours": 0,
        "avg_response": "",
        "status_code": 200,
        "last_success": "2018-12-10T11:31:55.455091-08:00"
    }
}

Incidents

View Service Incidents

View all incidents for a single service.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/services/1/incidents"
GET /api/services/1/incidents HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Content-Typeapplication/json
DateMon, 04 May 2020 03:13:44 GMT
Content-Length136
Connectionclose
[
    {
        "id": 1,
        "title": "Service Downtime",
        "service": 1,
        "created_at": "2020-05-04T03:11:51.752374Z",
        "updated_at": "2020-05-04T03:11:51.752374Z"
    }
]

Create Incident

Create an incident for a service.

curl -X POST -H "Content-Type: application/json" -d '{
	"title": "Service Downtime",
	"description": ""
}' "http://0.0.0.0:8585/api/services/1/incidents"
POST /api/services/1/incidents HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
	"title": "Service Downtime",
	"description": ""
}
Status200 OK
Content-Typeapplication/json
DateMon, 04 May 2020 03:11:51 GMT
Content-Length207
Connectionclose
{
    "status": "success",
    "type": "incident",
    "method": "create",
    "id": 1,
    "output": {
        "id": 1,
        "title": "Service Downtime",
        "service": 1,
        "created_at": "2020-05-04T03:11:51.752374Z",
        "updated_at": "2020-05-04T03:11:51.752374Z"
    }
}

Update Service Incident

View all incidents for a single service.

curl -X POST -H "Content-Type: application/json" -d '{
	"title": "Updated Downtime",
	"description": "This is an update for an incident"
}' "http://0.0.0.0:8585/api/incidents/1"
POST /api/incidents/1 HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
	"title": "Updated Downtime",
	"description": "This is an update for an incident"
}

Delete Incident

View all incidents for a single service.

curl -X DELETE -H "Content-Type: application/json" "http://0.0.0.0:8585/api/incidents/1"
DELETE /api/incidents/1 HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Content-Typeapplication/json
DateMon, 04 May 2020 03:31:48 GMT
Content-Length207
Connectionclose
{
    "status": "success",
    "type": "incident",
    "method": "delete",
    "id": 2,
    "output": {
        "id": 2,
        "title": "Service Downtime",
        "service": 1,
        "created_at": "2020-05-04T03:18:24.818629Z",
        "updated_at": "2020-05-04T03:18:24.818629Z"
    }
}

Incident Updates

View all incidents for a single service.

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/incidents/2/updates"
GET /api/incidents/2/updates HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

Create Incident Update

View all incidents for a single service.

curl -X POST -H "Content-Type: application/json" -d '{
	"message": "Website is loading very slowly, looking into this.",
	"type": "Investigating"
}' "http://0.0.0.0:8585/api/incidents/2/updates"
POST /api/incidents/2/updates HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
	"message": "Website is loading very slowly, looking into this.",
	"type": "Investigating"
}
Status200 OK
Content-Typeapplication/json
DateMon, 04 May 2020 03:20:05 GMT
Content-Length261
Connectionclose
{
    "status": "success",
    "type": "incident_update",
    "method": "create",
    "id": 1,
    "output": {
        "id": 1,
        "message": "Website is loading very slowly, looking into this.",
        "type": "Investigating",
        "created_at": "2020-05-04T03:20:05.102435Z",
        "updated_at": "2020-05-04T03:20:05.102435Z"
    }
}

Delete Incident Update

View all incidents for a single service.

curl -X DELETE -H "Content-Type: application/json" "http://0.0.0.0:8585/api/incidents/2/updates/1"
DELETE /api/incidents/2/updates/1 HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Content-Typeapplication/json
DateMon, 04 May 2020 03:23:00 GMT
Content-Length261
Connectionclose
{
    "status": "success",
    "type": "incident_update",
    "method": "delete",
    "id": 1,
    "output": {
        "id": 1,
        "message": "Website is loading very slowly, looking into this.",
        "type": "Investigating",
        "created_at": "2020-05-04T03:20:05.102435Z",
        "updated_at": "2020-05-04T03:20:05.102435Z"
    }
}

Groups

Statping allows you to group multiple services with a unique name for better viewablity. You can reorder the groups to make your status page a little more organized if you have tons of services.

Group Fields

  • name - (required) Group name to contain multiple services
  • public - Allow non-users to view this group and services inside it (default false)

All Groups

View an array of all Groups added to your Statping instance.

curl -X GET "http://0.0.0.0:8585/api/groups"
GET /api/groups HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateThu, 03 Jan 2019 21:48:40 GMT
Content-Length301
[
    {
        "id": 1,
        "name": "Main Services",
        "public": true,
        "created_at": "2019-01-03T13:48:23.488553261-08:00",
        "updated_at": "2019-01-03T13:48:23.488614502-08:00"
    },
    {
        "id": 2,
        "name": "Linked Services",
        "public": false,
        "created_at": "2019-01-03T13:48:23.489693923-08:00",
        "updated_at": "2019-01-03T13:48:23.489719447-08:00"
    }
]

View Group

View a specific group

curl -X GET -H "Content-Type: application/json" "http://0.0.0.0:8585/api/groups/1"
GET /api/groups/1 HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json
Status200 OK
Content-Typeapplication/json
DateThu, 03 Jan 2019 21:48:58 GMT
Content-Length148
{
    "id": 1,
    "name": "Main Services",
    "public": true,
    "created_at": "2019-01-03T13:48:23.488553261-08:00",
    "updated_at": "2019-01-03T13:48:23.488614502-08:00"
}

Create Group

Create a new Group to organize services.

curl -X POST -H "Content-Type: application/json" -d '{
    "name": "New Group",
    "public": true
}' "http://0.0.0.0:8585/api/groups"
POST /api/groups HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "name": "New Group",
    "public": true
}
Status200 OK
Content-Typeapplication/json
DateThu, 03 Jan 2019 21:49:25 GMT
Content-Length214
{
    "status": "success",
    "type": "group",
    "method": "create",
    "id": 3,
    "output": {
        "id": 3,
        "name": "New Group",
        "public": true,
        "created_at": "2019-01-03T13:49:25.947069211-08:00",
        "updated_at": "2019-01-03T13:49:25.947120276-08:00"
    }
}

Reorder Groups

Reorder services in a specific order for the index page.

curl -X POST -H "Content-Type: application/json" -d '[{"group":1,"order":1},{"group":2,"order":2}]' "http://0.0.0.0:8585/api/reorder/groups"
POST /api/reorder/groups HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

[{"group":1,"order":1},{"group":2,"order":2}]

Delete Group

Delete a group and removes all services attached to this group.

curl -X DELETE "http://0.0.0.0:8585/api/groups/{{group_id}}"
DELETE /api/groups/%7B%7Bgroup_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateThu, 03 Jan 2019 21:49:49 GMT
Content-Length214
{
    "status": "success",
    "type": "group",
    "method": "delete",
    "id": 3,
    "output": {
        "id": 3,
        "name": "New Group",
        "public": true,
        "created_at": "2019-01-03T13:49:25.947069211-08:00",
        "updated_at": "2019-01-03T13:49:25.947120276-08:00"
    }
}

Users

You can create new users with different permissions to allow for read only API access, and super admin abilities.

User Fields

  • username - (required) Unique username for the user to sign in as
  • email - (required) Unique email address for this user
  • password - (required) User password in plain text (will be encrypted)
  • admin - Set user as admin (default false)

Login

This endpoint will login a user and set a JWT token for future requests.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Type: application/x-www-form-urlencoded" -d "username=admin&password=admin" "http://0.0.0.0:8585/api/login"
POST /api/login HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/x-www-form-urlencoded
Content-Type: application/x-www-form-urlencoded

username=admin&password=admin
Status200 OK
Content-Length174
Content-Typeapplication/json
DateSat, 02 May 2020 00:56:17 GMT
Set-Cookiestatping_auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiYWRtaW4iOnRydWUsImV4cCI6MTU4ODY0MDE3N30.tf399_LfAphSGlKMtgphg6qpPrn-_w92XfCrK5FwbZY; Expires=Tue, 05 May 2020 00:56:17 GMT
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiYWRtaW4iOnRydWUsImV4cCI6MTU4ODY0MDE3N30.tf399_LfAphSGlKMtgphg6qpPrn-_w92XfCrK5FwbZY",
    "admin": true
}

Logout

This endpoint will logout a user and redirect to the index page.

curl -X GET "http://0.0.0.0:8585/api/logout"
GET /api/logout HTTP/1.1
Host: 0.0.0.0:8585

View All Users

View all users on your Statping instance.

curl -X GET "http://0.0.0.0:8585/api/users"
GET /api/users HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:32:23 GMT
Content-Length701
[
    {
        "id": 1,
        "username": "admin",
        "password": "$2a$14$KtPUxcclSu/DTwVCJ1uez.KbrQcGxWK8CKnvlXe1E8rbpALrR5IPi",
        "email": "info@admin.com",
        "api_key": "0a7181be6ce703851c59dcb8a4e47090f585d3de",
        "api_secret": "5fe0e1982f1669ed004ab59d5dc73a5ec375ae31",
        "admin": true,
        "created_at": "2018-12-10T11:15:41.12715-08:00",
        "updated_at": "2018-12-10T11:15:42.245315-08:00"
    },
    {
        "id": 6,
        "username": "adminuser2",
        "password": "$2a$14$T45y.jRn58G./bLIHO7enOl2c7Xhom9pGVuAo8.3hIPcH66.8ZwCq",
        "email": "info@adminemail.com",
        "api_key": "373b493a54c0dc8ce6f710e0b99c1fc968d691bb",
        "api_secret": "4f7c0469cf8c57032d7693edc8665379274e1f6f",
        "admin": true,
        "created_at": "2018-12-10T11:30:17.654832-08:00",
        "updated_at": "2018-12-10T11:30:18.699416-08:00"
    }
]

Create User

Create a new Statping user

curl -X POST -H "Content-Type: application/json" -d '{
    "username": "adminuser2",
    "email": "info@adminemail.com",
    "password": "passsword123",
    "admin": true
}' "http://0.0.0.0:8585/api/users"
POST /api/users HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "username": "adminuser2",
    "email": "info@adminemail.com",
    "password": "passsword123",
    "admin": true
}
Status200 OK
Content-Length468
Content-Typeapplication/json
DateSat, 02 May 2020 01:08:07 GMT
{
    "status": "success",
    "type": "user",
    "method": "create",
    "id": 2,
    "output": {
        "id": 2,
        "username": "adminuser2",
        "password": "$2a$14$gIGeiN8bLYTGtkTwhSDS7us5gGXJ3tpcxMEY9ynX.VnpCKDFVG3nO",
        "email": "info@adminemail.com",
        "api_key": "acbed53aec11c0a0a555eaae6ce73501c059215bf4bb6ae4b0fc0eb2765780a1",
        "api_secret": "3699ae08cb15ee85b6529f6895bd104a3be00f823b1aa3c810a6582676d55ba7",
        "admin": true,
        "created_at": "2020-05-02T01:08:06.971716991Z",
        "updated_at": "2020-05-02T01:08:06.971716991Z"
    }
}

View User

curl -X GET "http://0.0.0.0:8585/api/users/{{user_id}}"
GET /api/users/%7B%7Buser_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:32:50 GMT
Content-Length281
{
    "id": 6,
    "username": "adminuser2",
    "email": "info@adminemail.com",
    "api_key": "373b493a54c0dc8ce6f710e0b99c1fc968d691bb",
    "api_secret": "4f7c0469cf8c57032d7693edc8665379274e1f6f",
    "admin": true,
    "created_at": "2018-12-10T11:30:17.654832-08:00",
    "updated_at": "2018-12-10T11:30:18.699416-08:00"
}

Update User

Update a user’s information including username, email, password, and if they are an admin or not.

curl -X POST -H "Content-Type: application/json" -d '{
    "username": "adminupdated",
    "email": "info@email.com",
    "password": "password12345",
    "admin": true
}' "http://0.0.0.0:8585/api/users/{{user_id}}"
POST /api/users/%7B%7Buser_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "username": "adminupdated",
    "email": "info@email.com",
    "password": "password12345",
    "admin": true
}
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:32:58 GMT
Content-Length421
{
    "status": "success",
    "type": "user",
    "method": "update",
    "id": 6,
    "output": {
        "id": 6,
        "username": "adminupdated",
        "password": "$2a$14$fAUBFWOYtEjj/rhVkGop/Os9OPwCzNOw0ZW7naSSyAs4J7KQeZFCe",
        "email": "info@email.com",
        "api_key": "c9a5d9cba5a0062812be9d080a54080397b41058",
        "api_secret": "e81a58e019c8ce88f3272057ba67c7ab52b4a988",
        "admin": true,
        "created_at": "2018-12-10T11:30:17.654832-08:00",
        "updated_at": "2018-12-10T11:30:18.699416-08:00"
    }
}

Delete User

Delete a specific user from the database.

curl -X DELETE "http://0.0.0.0:8585/api/users/{{user_id}}"
DELETE /api/users/%7B%7Buser_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:33:06 GMT
Content-Length421
{
    "status": "success",
    "type": "user",
    "method": "delete",
    "id": 6,
    "output": {
        "id": 6,
        "username": "adminupdated",
        "password": "$2a$14$fAUBFWOYtEjj/rhVkGop/Os9OPwCzNOw0ZW7naSSyAs4J7KQeZFCe",
        "email": "info@email.com",
        "api_key": "c9a5d9cba5a0062812be9d080a54080397b41058",
        "api_secret": "e81a58e019c8ce88f3272057ba67c7ab52b4a988",
        "admin": true,
        "created_at": "2018-12-10T11:30:17.654832-08:00",
        "updated_at": "2018-12-10T11:32:58.602809-08:00"
    }
}

Notifiers

Statping contains multiple notifiers that will send you a notification whenever a service become offline, or online. You can create your own 3rd party notifier by reading more on the Notifiers Wiki on the Github repo.

All Notifiers

View an array of all the Notifiers including all details about the notifier.

curl -X GET "http://0.0.0.0:8585/api/notifiers"
GET /api/notifiers HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateSat, 02 May 2020 01:08:49 GMT
Transfer-Encodingchunked
[
    {
        "id": 1,
        "method": "slack",
        "host": "https://webhooksurl.slack.com/***",
        "enabled": false,
        "limits": 60,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.404253878Z",
        "updated_at": "2020-05-02T01:00:13.404253878Z",
        "title": "slack",
        "description": "Send notifications to your slack channel when a service is offline. Insert your Incoming webhook URL for your channel to receive notifications. Based on the Slack API.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "fab fa-slack",
        "delay": "10000000000",
        "form": [
            {
                "type": "text",
                "title": "Incoming Webhook Url",
                "placeholder": "Insert your Slack Webhook URL here.",
                "field": "Host",
                "small_text": "Incoming Webhook URL from Slack Apps",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 2,
        "method": "command",
        "host": "/bin/bash",
        "enabled": false,
        "limits": 60,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.495166024Z",
        "updated_at": "2020-05-02T01:00:13.495166024Z",
        "title": "Command",
        "description": "Shell Command allows you to run a customized shell/bash Command on the local machine it's running on.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "fas fa-terminal",
        "delay": "1000000000",
        "form": [
            {
                "type": "text",
                "title": "Shell or Bash",
                "placeholder": "/usr/bin/curl",
                "field": "host",
                "small_text": "You can use '/bin/sh', '/bin/bash', '/usr/bin/curl' or an absolute path for an application.",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "Command to Run on OnSuccess",
                "placeholder": "http://localhost:8080/health",
                "field": "var1",
                "small_text": "This Command will run when a service is receiving a Successful event.",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "Command to Run on OnFailure",
                "placeholder": "http://localhost:8080/health",
                "field": "var2",
                "small_text": "This Command will run when a service is receiving a Failing event.",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 3,
        "method": "discord",
        "host": "https://discordapp.com/api/webhooks/****/*****",
        "enabled": false,
        "limits": 60,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.578783367Z",
        "updated_at": "2020-05-02T01:00:13.578783367Z",
        "title": "discord",
        "description": "Send notifications to your discord channel using discord webhooks. Insert your discord channel Webhook URL to receive notifications. Based on the discord webhooker API.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "fab fa-discord",
        "delay": "5000000000",
        "form": [
            {
                "type": "text",
                "title": "discord webhooker URL",
                "placeholder": "Insert your Webhook URL here",
                "field": "host",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 4,
        "method": "email",
        "enabled": false,
        "limits": 30,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.662437032Z",
        "updated_at": "2020-05-02T01:00:13.662437032Z",
        "title": "email",
        "description": "Send emails via SMTP when services are online or offline.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "far fa-envelope",
        "delay": "0",
        "form": [
            {
                "type": "text",
                "title": "SMTP Host",
                "placeholder": "Insert your SMTP Host here.",
                "field": "Host",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "SMTP Username",
                "placeholder": "Insert your SMTP Username here.",
                "field": "Username",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "password",
                "title": "SMTP Password",
                "placeholder": "Insert your SMTP Password here.",
                "field": "Password",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "number",
                "title": "SMTP Port",
                "placeholder": "Insert your SMTP Port here.",
                "field": "Port",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "Outgoing Email Address",
                "placeholder": "outgoing@email.com",
                "field": "Var1",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "email",
                "title": "Send Alerts To",
                "placeholder": "sendto@email.com",
                "field": "Var2",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "Disable TLS/SSL",
                "placeholder": "",
                "field": "api_key",
                "small_text": "To Disable TLS/SSL insert 'true'",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 5,
        "method": "line_notify",
        "enabled": false,
        "limits": 60,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.762720435Z",
        "updated_at": "2020-05-02T01:00:13.762720435Z",
        "title": "LINE Notify",
        "description": "LINE Notify will send notifications to your LINE Notify account when services are offline or online. Based on the LINE Notify API.",
        "author": "Kanin Peanviriyakulkit",
        "author_url": "https://github.com/dogrocker",
        "icon": "far fa-bell",
        "delay": "0",
        "form": [
            {
                "type": "text",
                "title": "Access Token",
                "placeholder": "Insert your Line Notify Access Token here.",
                "field": "api_secret",
                "small_text": "",
                "required": false,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 6,
        "method": "telegram",
        "enabled": false,
        "limits": 60,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.863052768Z",
        "updated_at": "2020-05-02T01:00:13.863052768Z",
        "title": "Telegram",
        "description": "Receive notifications on your Telegram channel when a service has an issue. You must get a Telegram API token from the /botfather. Review the Telegram API Tutorial to learn how to generate a new API Token.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "fab fa-telegram-plane",
        "delay": "5000000000",
        "form": [
            {
                "type": "text",
                "title": "Telegram API Token",
                "placeholder": "383810182:EEx829dtCeufeQYXG7CUdiQopqdmmxBPO7-s",
                "field": "api_secret",
                "small_text": "Enter the API Token given to you from the /botfather chat.",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "Channel or User",
                "placeholder": "@statping_channel",
                "field": "var1",
                "small_text": "Insert your Telegram Channel or User here.",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 7,
        "method": "twilio",
        "enabled": false,
        "limits": 15,
        "removable": false,
        "created_at": "2020-05-02T01:00:13.929911704Z",
        "updated_at": "2020-05-02T01:00:13.929911704Z",
        "title": "Twilio",
        "description": "Receive SMS text messages directly to your cellphone when a service is offline. You can use a Twilio test account with limits. This notifier uses the Twilio API.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "far fa-comment-alt",
        "delay": "10000000000",
        "form": [
            {
                "type": "text",
                "title": "Account SID",
                "placeholder": "Insert your Twilio Account SID",
                "field": "api_key",
                "small_text": "",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "Account Token",
                "placeholder": "Insert your Twilio Account Token",
                "field": "api_secret",
                "small_text": "",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "SMS to Phone Number",
                "placeholder": "18555555555",
                "field": "Var1",
                "small_text": "",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "From Phone Number",
                "placeholder": "18555555555",
                "field": "Var2",
                "small_text": "",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            }
        ]
    },
    {
        "id": 8,
        "method": "webhook",
        "enabled": false,
        "limits": 180,
        "removable": false,
        "created_at": "2020-05-02T01:00:14.022113554Z",
        "updated_at": "2020-05-02T01:00:14.022113554Z",
        "title": "Webhook",
        "description": "Send a custom HTTP request to a specific URL with your own body, headers, and parameters.",
        "author": "Hunter Long",
        "author_url": "https://github.com/hunterlong",
        "icon": "fas fa-code-branch",
        "delay": "1000000000",
        "form": [
            {
                "type": "text",
                "title": "HTTP Endpoint",
                "placeholder": "http://webhookurl.com/JW2MCP4SKQP",
                "field": "Host",
                "small_text": "Insert the URL for your HTTP Requests.",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "text",
                "title": "HTTP Method",
                "placeholder": "POST",
                "field": "Var1",
                "small_text": "Choose a HTTP method for example: GET, POST, DELETE, or PATCH.",
                "required": true,
                "hidden": false,
                "list": false,
                "switch": false
            },
            {
                "type": "textarea",
                "title": "HTTP Body",
                "placeholder": "{\"service_id\": {{.Service.Id}}\", \"service_name\": \"{{.Service.Name}\"}",
                "field": "Var2",
                "small_text": "Optional HTTP body for a POST request. You can insert variables into your body request.
{{.Service.Id}}, {{.Service.Name}}, {{.Service.Online}}
{{.Failure.Issue}}", "required": false, "hidden": false, "list": false, "switch": false }, { "type": "text", "title": "Content Type", "placeholder": "application/json", "field": "api_key", "small_text": "Optional content type for example: application/json or text/plain", "required": false, "hidden": false, "list": false, "switch": false }, { "type": "text", "title": "Header", "placeholder": "Authorization=Token12345", "field": "api_secret", "small_text": "Optional Headers for request use format: KEY=Value,Key=Value", "required": false, "hidden": false, "list": false, "switch": false } ] }, { "id": 9, "method": "mobile", "enabled": false, "limits": 30, "removable": false, "created_at": "2020-05-02T01:00:14.088815317Z", "updated_at": "2020-05-02T01:00:14.088815317Z", "title": "Mobile", "description": "Receive push notifications on your Mobile device using the Statping App. You can scan the Authentication QR Code found in Settings to get the Mobile app setup in seconds.\n\t\t\t\t

", "author": "Hunter Long", "author_url": "https://github.com/hunterlong", "icon": "fas fa-mobile-alt", "delay": "5000000000", "form": [ { "type": "text", "title": "Device Identifiers", "placeholder": "A list of your Mobile device push notification ID's.", "field": "var1", "small_text": "", "required": false, "hidden": true, "list": false, "switch": false }, { "type": "number", "title": "Array of device numbers", "placeholder": "1 for iphone 2 for android", "field": "var2", "small_text": "", "required": false, "hidden": true, "list": false, "switch": false } ] }, { "id": 10, "method": "pushover", "enabled": false, "limits": 60, "removable": false, "created_at": "2020-05-02T01:00:14.172478892Z", "updated_at": "2020-05-02T01:00:14.172478892Z", "title": "Pushover", "description": "Use Pushover to receive push notifications. You will need to create a New Application on Pushover before using this notifier.", "author": "Hunter Long", "author_url": "https://github.com/hunterlong", "icon": "fa dot-circle", "delay": "10000000000", "form": [ { "type": "text", "title": "User Token", "placeholder": "Insert your device's Pushover Token", "field": "api_key", "small_text": "", "required": true, "hidden": false, "list": false, "switch": false }, { "type": "text", "title": "Application API Key", "placeholder": "Create an Application and insert the API Key here", "field": "api_secret", "small_text": "", "required": true, "hidden": false, "list": false, "switch": false } ] } ]

View Notifier

View a specific notifier and it’s details.

curl -X GET "http://0.0.0.0:8585/api/notifier/slack"
GET /api/notifier/slack HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length297
Content-Typeapplication/json
DateSat, 02 May 2020 01:09:06 GMT
{
    "id": 1,
    "method": "slack",
    "host": "https://webhooksurl.slack.com/***",
    "enabled": false,
    "limits": 60,
    "removable": false,
    "created_at": "2020-05-02T01:09:06.326407831Z",
    "updated_at": "2020-05-02T01:09:06.326408155Z",
    "title": "",
    "description": "",
    "author": "",
    "author_url": "",
    "icon": "",
    "delay": "0",
    "form": null
}

Update Notifier

Update a notifier to change it’s values.

curl -X POST -H "Content-Type: application/json" -d '{
    "method": "slack",
    "host": "https://hooks.slack.com/services/EXAMPLEIDHERE/BV33WKP0C/MtKw3Kc8BFylTv4pohKqHtXX",
    "enabled": true,
    "limits": 55
}' "http://0.0.0.0:8585/api/notifier/slack"
POST /api/notifier/slack HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "method": "slack",
    "host": "https://hooks.slack.com/services/EXAMPLEIDHERE/BV33WKP0C/MtKw3Kc8BFylTv4pohKqHtXX",
    "enabled": true,
    "limits": 55
}
Status200 OK
Content-Length72
Content-Typeapplication/json
DateSat, 02 May 2020 01:09:45 GMT
{
    "status": "success",
    "type": "string",
    "method": "update",
    "output": "slack"
}

Test Notifier

Update a notifier to change it’s values.

curl -X POST -H "Content-Type: application/json" -d '{
    "method": "slack",
    "host": "https://hooks.slack.com/services/EXAMPLEIDHERE/BV33WKP0C/MtKw3Kc8BFylTv4pohKqHtXX",
    "enabled": true,
    "limits": 55
}' "http://0.0.0.0:8585/api/notifier/slack/test"
POST /api/notifier/slack/test HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "method": "slack",
    "host": "https://hooks.slack.com/services/EXAMPLEIDHERE/BV33WKP0C/MtKw3Kc8BFylTv4pohKqHtXX",
    "enabled": true,
    "limits": 55
}
Status200 OK
Content-Typeapplication/json
DateMon, 04 May 2020 03:25:07 GMT
Connectionclose
Transfer-Encodingchunked
{
    "success": false,
    "response": "There's been a glitch… | Slack

There’s been a glitch…

We’re not quite sure what went wrong. You can go back, or try looking on our Help Center if you need a hand.

\n\n\n\n", "error": {} }

Messages

Messages allows you to create an alert for a service for a scheduled downtime, or a simple message letting users know a service might be having internal issues.

Message Fields

  • title - (required) Group name to contain multiple services
  • description - (required) More detailed description of message
  • service - Service ID to affiliate message, global message if empty
  • start_on - Timestamp to make this message visible on frontend
  • end_on - Timestamp to remove this message on frontend

All Messages

View an array of all messages inserted into the database.

curl -X GET "http://0.0.0.0:8585/api/messages"
GET /api/messages HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:33:17 GMT
Content-Length1169
[
    {
        "id": 1,
        "title": "Routine Downtime",
        "description": "This is an example a upcoming message for a service!",
        "start_on": "2018-12-10T11:30:42.259843-08:00",
        "end_on": "2018-12-10T13:15:42.259844-08:00",
        "service": 1,
        "notify_users": null,
        "notify_method": "",
        "notify_before": null,
        "notify_before_scale": "",
        "created_at": "2018-12-10T11:15:42.259845-08:00",
        "updated_at": "2018-12-10T11:15:42.260024-08:00"
    },
    {
        "id": 2,
        "title": "Server Reboot",
        "description": "This is another example a upcoming message for a service!",
        "start_on": "2018-12-10T11:30:42.261412-08:00",
        "end_on": "2018-12-10T13:15:42.261413-08:00",
        "service": 3,
        "notify_users": null,
        "notify_method": "",
        "notify_before": null,
        "notify_before_scale": "",
        "created_at": "2018-12-10T11:15:42.261414-08:00",
        "updated_at": "2018-12-10T11:15:42.261494-08:00"
    },
    {
        "id": 4,
        "title": "API Message",
        "description": "This is an example a upcoming message for a service!",
        "start_on": "2022-11-17T03:28:16.323797-08:00",
        "end_on": "2022-11-17T05:13:16.323798-08:00",
        "service": 1,
        "notify_users": true,
        "notify_method": "email",
        "notify_before": 6,
        "notify_before_scale": "hour",
        "created_at": "2018-12-10T11:16:42.658695-08:00",
        "updated_at": "2018-12-10T11:16:42.658771-08:00"
    }
]

Create Message

Create a new message show show on index page, or on a service.

curl -X POST -H "Content-Type: application/json" -d '{
    "title": "API Message",
    "description": "This is an example a upcoming message for a service!",
    "start_on": "2022-11-17T03:28:16.323797-08:00",
    "end_on": "2022-11-17T05:13:16.323798-08:00",
    "service": 1,
    "notify_users": true,
    "notify_method": "email",
    "notify_before": 6,
    "notify_before_scale": "hour"
}' "http://0.0.0.0:8585/api/messages"
POST /api/messages HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "title": "API Message",
    "description": "This is an example a upcoming message for a service!",
    "start_on": "2022-11-17T03:28:16.323797-08:00",
    "end_on": "2022-11-17T05:13:16.323798-08:00",
    "service": 1,
    "notify_users": true,
    "notify_method": "email",
    "notify_before": 6,
    "notify_before_scale": "hour"
}
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:33:25 GMT
Content-Length456
{
    "status": "success",
    "type": "message",
    "method": "create",
    "id": 8,
    "output": {
        "id": 8,
        "title": "API Message",
        "description": "This is an example a upcoming message for a service!",
        "start_on": "2022-11-17T03:28:16.323797-08:00",
        "end_on": "2022-11-17T05:13:16.323798-08:00",
        "service": 1,
        "notify_users": true,
        "notify_method": "email",
        "notify_before": 6,
        "notify_before_scale": "hour",
        "created_at": "2018-12-10T19:33:25.875858Z",
        "updated_at": "2018-12-10T11:33:25.875947-08:00"
    }
}

View Message

View a specific message and it’s details.

curl -X GET "http://0.0.0.0:8585/api/messages/{{message_id}}"
GET /api/messages/%7B%7Bmessage_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:33:33 GMT
Content-Length389
{
    "id": 8,
    "title": "API Message",
    "description": "This is an example a upcoming message for a service!",
    "start_on": "2022-11-17T03:28:16.323797-08:00",
    "end_on": "2022-11-17T05:13:16.323798-08:00",
    "service": 1,
    "notify_users": true,
    "notify_method": "email",
    "notify_before": 6,
    "notify_before_scale": "hour",
    "created_at": "2018-12-10T11:33:25.875858-08:00",
    "updated_at": "2018-12-10T11:33:25.875947-08:00"
}

Update Message

Update a specific message with new details.

curl -X POST -H "Content-Type: application/json" -d '{
    "title": "Updated Message",
    "description": "This message was updated",
    "start_on": "2022-11-17T03:28:16.323797-08:00",
    "end_on": "2022-11-17T05:13:16.323798-08:00",
    "service": 1,
    "notify_users": true,
    "notify_method": "email",
    "notify_before": 3,
    "notify_before_scale": "hour"
}' "http://0.0.0.0:8585/api/messages/{{message_id}}"
POST /api/messages/%7B%7Bmessage_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "title": "Updated Message",
    "description": "This message was updated",
    "start_on": "2022-11-17T03:28:16.323797-08:00",
    "end_on": "2022-11-17T05:13:16.323798-08:00",
    "service": 1,
    "notify_users": true,
    "notify_method": "email",
    "notify_before": 3,
    "notify_before_scale": "hour"
}
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:33:39 GMT
Content-Length437
{
    "status": "success",
    "type": "message",
    "method": "update",
    "id": 8,
    "output": {
        "id": 8,
        "title": "Updated Message",
        "description": "This message was updated",
        "start_on": "2022-11-17T03:28:16.323797-08:00",
        "end_on": "2022-11-17T05:13:16.323798-08:00",
        "service": 1,
        "notify_users": true,
        "notify_method": "email",
        "notify_before": 3,
        "notify_before_scale": "hour",
        "created_at": "2018-12-10T11:33:25.875858-08:00",
        "updated_at": "2018-12-10T11:33:25.875947-08:00"
    }
}

Delete Message

Delete a specific message from the database.

curl -X DELETE "http://0.0.0.0:8585/api/messages/{{message_id}}"
DELETE /api/messages/%7B%7Bmessage_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:33:47 GMT
Content-Length437
{
    "status": "success",
    "type": "message",
    "method": "delete",
    "id": 8,
    "output": {
        "id": 8,
        "title": "Updated Message",
        "description": "This message was updated",
        "start_on": "2022-11-17T03:28:16.323797-08:00",
        "end_on": "2022-11-17T05:13:16.323798-08:00",
        "service": 1,
        "notify_users": true,
        "notify_method": "email",
        "notify_before": 3,
        "notify_before_scale": "hour",
        "created_at": "2018-12-10T11:33:25.875858-08:00",
        "updated_at": "2018-12-10T11:33:39.797941-08:00"
    }
}

Checkins

A Checkin is when a service communicates to your Statping instance rather than Statping attempting to hit your service. Checkin’s have a scheduled interval that waits for your service to notify Statping, if your service does not hit the Checkin URL during the interval you set, it will result in a service failing notification.

View All Checkin's

View an array of all the Checkin’s inserted into the system.

curl -X GET "http://0.0.0.0:8585/api/checkins"
GET /api/checkins HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:34:16 GMT
Content-Length268
[
    {
        "id": 5,
        "service_id": 2,
        "name": "Server Checkin",
        "interval": 900,
        "grace": 60,
        "api_key": "1emn9ha",
        "created_at": "2018-12-10T11:34:10.991372-08:00",
        "updated_at": "2018-12-10T11:34:10.991372-08:00",
        "failing": false,
        "last_hit": "0001-01-01T00:00:00Z",
        "hits": [],
        "failures": null
    }
]

Create Checkin

Create a new Checkin.

curl -X POST -H "Content-Type: application/json" -d '{
    "service_id": 2,
    "name": "Server Checkin",
    "interval": 900,
    "grace": 60
}' "http://0.0.0.0:8585/api/checkins"
POST /api/checkins HTTP/1.1
Host: 0.0.0.0:8585
Content-Type: application/json

{
    "service_id": 2,
    "name": "Server Checkin",
    "interval": 900,
    "grace": 60
}
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:34:10 GMT
Content-Length330
{
    "status": "success",
    "type": "checkin",
    "method": "create",
    "id": 5,
    "output": {
        "id": 5,
        "service_id": 2,
        "name": "Server Checkin",
        "interval": 900,
        "grace": 60,
        "api_key": "1emn9ha",
        "created_at": "2018-12-10T19:34:10.991372Z",
        "updated_at": "2018-12-10T19:34:10.991372Z",
        "failing": false,
        "last_hit": "0001-01-01T00:00:00Z",
        "hits": null,
        "failures": null
    }
}

Run Checkin

Initiate the Checkin request to your Statping instance. This request will come from your service and will trigger a failure if your service does not hit this URL in the routine interval set.

  • checkin_id is the ID for the checkin
curl -X GET "http://0.0.0.0:8585/checkin/{{checkin_id}}"
GET /checkin/%7B%7Bcheckin_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:34:23 GMT
Content-Length147
{
    "status": "success",
    "type": "checkin_hit",
    "method": "update",
    "id": 5,
    "output": {
        "id": 5,
        "from": "127.0.0.1",
        "created_at": "2018-12-10T19:34:23.442087Z"
    }
}

View Checkin

View a specific checkin and it’s details.

curl -X GET "http://0.0.0.0:8585/api/checkins/{{checkin_id}}"
GET /api/checkins/%7B%7Bcheckin_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:34:29 GMT
Content-Length338
{
    "id": 5,
    "service_id": 2,
    "name": "Server Checkin",
    "interval": 900,
    "grace": 60,
    "api_key": "1emn9ha",
    "created_at": "2018-12-10T19:34:10.991372Z",
    "updated_at": "2018-12-10T19:34:10.991372Z",
    "failing": false,
    "last_hit": "2018-12-10T11:34:23.443663-08:00",
    "hits": [
        {
            "id": 5,
            "from": "127.0.0.1",
            "created_at": "2018-12-10T19:34:23.442087Z"
        }
    ],
    "failures": null
}

Delete Checkin

Delete a checkin from database and stop failures from service not hitting the checkin URL.

curl -X DELETE "http://0.0.0.0:8585/api/checkins/{{checkin_id}}"
DELETE /api/checkins/%7B%7Bcheckin_id%7D%7D HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Typeapplication/json
DateMon, 10 Dec 2018 19:34:35 GMT
Content-Length410
{
    "status": "success",
    "type": "checkin",
    "method": "delete",
    "id": 5,
    "output": {
        "id": 5,
        "service_id": 2,
        "name": "Server Checkin",
        "interval": 900,
        "grace": 60,
        "api_key": "1emn9ha",
        "created_at": "2018-12-10T19:34:10.991372Z",
        "updated_at": "2018-12-10T19:34:10.991372Z",
        "failing": false,
        "last_hit": "2018-12-10T11:34:23.443663-08:00",
        "hits": [
            {
                "id": 5,
                "from": "127.0.0.1",
                "created_at": "2018-12-10T19:34:23.442087Z"
            }
        ],
        "failures": null
    }
}

Theme

You can edit the SASS files to create a custom theme for your Statping Instance. For you to use themes, you must have sass installed on your location system.

You will need to have sass installed and available in your $PATH.

Asset Files

  • variables.scss - SASS variables
  • base.scss - Main theme for Statping
  • mobile.scss - Custom mobile designs using viewports

Create Assets

This endpoint will create the assets folder and dump all css, js, and image assets into that folder. If assets have already been created, it will return an error.

{
  "error": "assets have already been created"
}
curl -X GET "http://0.0.0.0:8585/api/theme/create"
GET /api/theme/create HTTP/1.1
Host: 0.0.0.0:8585

Get SASS Files

This endpoint will return the path where the assets are stored, and the raw data for each sass files. - base.scss - variables.scss - mobile.scss

curl -X GET "http://0.0.0.0:8585/api/theme"
GET /api/theme HTTP/1.1
Host: 0.0.0.0:8585

Update Theme

This endpoint will update the sass files and compile sass into css.

curl -X POST -d '{
    "base": "",
    "variables": "",
    "mobile": ""
}' "http://0.0.0.0:8585/api/theme"
POST /api/theme HTTP/1.1
Host: 0.0.0.0:8585

{
    "base": "",
    "variables": "",
    "mobile": ""
}

Delete Assets

This endpoint will delete the assets folder.

curl -X DELETE "http://0.0.0.0:8585/api/theme"
DELETE /api/theme HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length79
Content-Typeapplication/json
DateSat, 02 May 2020 01:15:10 GMT
{
    "status": "success",
    "type": "string",
    "method": "deleted",
    "output": "/app/assets"
}

oAuth

You can allow other users to login through other services by using OAuth.

Redirect URL

Each OAuth service has a dedicated redirect URL: /oauth/{provider}. Replace {provider} with google, slack, or github depending on which service you’re using.

Set Keys

This endpoint will return the last line in the logs.

curl -X POST -d '{
    "gh_client_id": "githubid",
    "gh_client_secret": "githubsecret",
    "google_client_id": "googleid",
    "google_client_secret": "googlesecret",
    "oauth_domains": "gmail.com,yahoo.com,socialeck.com",
    "oauth_providers": "local,slack,google,github",
    "slack_client_id": "936045034737.1044972172659",
    "slack_client_secret": "05dd514efb382971e538a5561981e54a",
    "slack_team": "dev"
}' "http://0.0.0.0:8585/api/oauth"
POST /api/oauth HTTP/1.1
Host: 0.0.0.0:8585

{
    "gh_client_id": "githubid",
    "gh_client_secret": "githubsecret",
    "google_client_id": "googleid",
    "google_client_secret": "googlesecret",
    "oauth_domains": "gmail.com,yahoo.com,socialeck.com",
    "oauth_providers": "local,slack,google,github",
    "slack_client_id": "936045034737.1044972172659",
    "slack_client_secret": "05dd514efb382971e538a5561981e54a",
    "slack_team": "dev"
}
Status200 OK
Content-Length398
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:09 GMT
{
    "admin": false,
    "allow_reports": false,
    "created_at": "2020-05-02T01:00:07.885973685Z",
    "description": "This data is only used to testing",
    "domain": "http://localhost:8080",
    "footer": null,
    "logged_in": false,
    "migration_id": 1588381207,
    "name": "Statping Sample Data",
    "setup": true,
    "started_on": "2020-05-02T01:00:14.255837864Z",
    "updated_at": "2020-05-02T01:00:12.731269305Z",
    "using_cdn": false,
    "version": "0.90.34"
}

Get Keys

This endpoint will return the last line in the logs.

curl -X GET "http://0.0.0.0:8585/api/oauth"
GET /api/oauth HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length398
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:09 GMT
{
    "admin": false,
    "allow_reports": false,
    "created_at": "2020-05-02T01:00:07.885973685Z",
    "description": "This data is only used to testing",
    "domain": "http://localhost:8080",
    "footer": null,
    "logged_in": false,
    "migration_id": 1588381207,
    "name": "Statping Sample Data",
    "setup": true,
    "started_on": "2020-05-02T01:00:14.255837864Z",
    "updated_at": "2020-05-02T01:00:12.731269305Z",
    "using_cdn": false,
    "version": "0.90.34"
}

Authenticate token

This endpoint will return the last line in the logs.

curl -X GET "http://0.0.0.0:8585/oauth/slack"
GET /oauth/slack HTTP/1.1
Host: 0.0.0.0:8585
Status200 OK
Content-Length398
Content-Typeapplication/json
DateSat, 02 May 2020 01:06:09 GMT
{
    "admin": false,
    "allow_reports": false,
    "created_at": "2020-05-02T01:00:07.885973685Z",
    "description": "This data is only used to testing",
    "domain": "http://localhost:8080",
    "footer": null,
    "logged_in": false,
    "migration_id": 1588381207,
    "name": "Statping Sample Data",
    "setup": true,
    "started_on": "2020-05-02T01:00:14.255837864Z",
    "updated_at": "2020-05-02T01:00:12.731269305Z",
    "using_cdn": false,
    "version": "0.90.34"
}