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.
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
.
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
.
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.
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.
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.
{
"error": "Statping has already been setup"
}
db_connection
- Database connection type. (sqlite, mysql, postgres)db_user
- Username for databasedb_password
- Password for databasedb_database
- Database name for Statpingdb_port
- Port number for the databasedb_host
- Hostname or IP for the running database servercurl -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
This is for Statping’s miscellaneous API endpoints that aren’t a part of another category.
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
Status | 200 OK |
---|---|
Content-Length | 398 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:09 GMT |
|
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
Status | 200 OK |
---|---|
Content-Length | 398 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:09 GMT |
|
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
Status | 200 OK |
---|---|
Content-Length | 398 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:09 GMT |
|
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
Status | 200 OK |
---|---|
Content-Length | 42 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:03:29 GMT |
|
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
Status | 200 OK |
---|---|
Content-Type | text/plain; charset=utf-8 |
Date | Sat, 02 May 2020 01:05:53 GMT |
Transfer-Encoding | chunked |
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
Status | 200 OK |
---|---|
Content-Length | 21 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:43 GMT |
|
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
Status | 200 OK |
---|---|
Content-Length | 1631 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:32 GMT |
|
You can create custom badges with dynamic information by using Shields.io and parsing JSON fields with JSONPath.
$.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=%
$.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
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.
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Sat, 02 May 2020 01:07:00 GMT |
Transfer-Encoding | chunked |
|
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
Status | 200 OK |
---|---|
Content-Length | 534 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:07:16 GMT |
|
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.
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
Status | 200 OK |
---|---|
Access-Control-Allow-Origin | * |
Content-Type | application/json |
Date | Fri, 01 May 2020 23:35:21 GMT |
Transfer-Encoding | chunked |
|
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.
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
Status | 200 OK |
---|---|
Access-Control-Allow-Origin | * |
Content-Length | 374 |
Content-Type | application/json |
Date | Fri, 01 May 2020 23:36:34 GMT |
|
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.
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
Status | 200 OK |
---|---|
Access-Control-Allow-Origin | * |
Content-Length | 344 |
Content-Type | application/json |
Date | Fri, 01 May 2020 23:39:38 GMT |
|
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
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 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}]
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:31:40 GMT |
Content-Length | 122 |
|
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
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:31:47 GMT |
Content-Length | 528 |
|
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
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:31:54 GMT |
Content-Length | 567 |
|
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 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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:32:06 GMT |
Content-Length | 567 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 04 May 2020 03:13:44 GMT |
Content-Length | 136 |
Connection | close |
|
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": ""
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 04 May 2020 03:11:51 GMT |
Content-Length | 207 |
Connection | close |
|
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"
}
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 04 May 2020 03:31:48 GMT |
Content-Length | 207 |
Connection | close |
|
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
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"
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 04 May 2020 03:20:05 GMT |
Content-Length | 261 |
Connection | close |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 04 May 2020 03:23:00 GMT |
Content-Length | 261 |
Connection | close |
|
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.
name
- (required) Group name to contain multiple servicespublic
- Allow non-users to view this group and services inside it (default false)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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Thu, 03 Jan 2019 21:48:40 GMT |
Content-Length | 301 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Thu, 03 Jan 2019 21:48:58 GMT |
Content-Length | 148 |
|
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
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Thu, 03 Jan 2019 21:49:25 GMT |
Content-Length | 214 |
|
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 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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Thu, 03 Jan 2019 21:49:49 GMT |
Content-Length | 214 |
|
You can create new users with different permissions to allow for read only API access, and super admin abilities.
username
- (required) Unique username for the user to sign in asemail
- (required) Unique email address for this userpassword
- (required) User password in plain text (will be encrypted)admin
- Set user as admin (default false)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
Status | 200 OK |
---|---|
Content-Length | 174 |
Content-Type | application/json |
Date | Sat, 02 May 2020 00:56:17 GMT |
Set-Cookie | statping_auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiYWRtaW4iOnRydWUsImV4cCI6MTU4ODY0MDE3N30.tf399_LfAphSGlKMtgphg6qpPrn-_w92XfCrK5FwbZY; Expires=Tue, 05 May 2020 00:56:17 GMT |
|
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 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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:32:23 GMT |
Content-Length | 701 |
|
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
}
Status | 200 OK |
---|---|
Content-Length | 468 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:08:07 GMT |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:32:50 GMT |
Content-Length | 281 |
|
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
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:32:58 GMT |
Content-Length | 421 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:33:06 GMT |
Content-Length | 421 |
|
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.
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Sat, 02 May 2020 01:08:49 GMT |
Transfer-Encoding | chunked |
|
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
Status | 200 OK |
---|---|
Content-Length | 297 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:09:06 GMT |
|
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
}
Status | 200 OK |
---|---|
Content-Length | 72 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:09:45 GMT |
|
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
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 04 May 2020 03:25:07 GMT |
Connection | close |
Transfer-Encoding | chunked |
|
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.
title
- (required) Group name to contain multiple servicesdescription
- (required) More detailed description of messageservice
- Service ID to affiliate message, global message if emptystart_on
- Timestamp to make this message visible on frontendend_on
- Timestamp to remove this message on frontendView 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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:33:17 GMT |
Content-Length | 1169 |
|
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"
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:33:25 GMT |
Content-Length | 456 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:33:33 GMT |
Content-Length | 389 |
|
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"
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:33:39 GMT |
Content-Length | 437 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:33:47 GMT |
Content-Length | 437 |
|
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 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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:34:16 GMT |
Content-Length | 268 |
|
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
}
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:34:10 GMT |
Content-Length | 330 |
|
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 checkincurl -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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:34:23 GMT |
Content-Length | 147 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:34:29 GMT |
Content-Length | 338 |
|
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
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Mon, 10 Dec 2018 19:34:35 GMT |
Content-Length | 410 |
|
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
.
variables.scss
- SASS variablesbase.scss
- Main theme for Statpingmobile.scss
- Custom mobile designs using viewportsThis 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
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
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": ""
}
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
Status | 200 OK |
---|---|
Content-Length | 79 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:15:10 GMT |
|
You can allow other users to login through other services by using OAuth.
Each OAuth service has a dedicated redirect URL: /oauth/{provider}
. Replace {provider}
with google, slack, or github depending on which service you’re using.
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"
}
Status | 200 OK |
---|---|
Content-Length | 398 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:09 GMT |
|
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
Status | 200 OK |
---|---|
Content-Length | 398 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:09 GMT |
|
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
Status | 200 OK |
---|---|
Content-Length | 398 |
Content-Type | application/json |
Date | Sat, 02 May 2020 01:06:09 GMT |
|