TABLE OF CONTENTS
- Overview
- What API commands are used by Freshping?
- Rate Limit
- Policies
- Deprecation Policy
- Breaking Change Policy
- Authentication
- Where can I find my API key?
- Checks
- Users
Overview
Freshping allows companies to monitor their websites from 10 different locations. Users can monitor uptime/downtime, outages and performance of websites, APIs, web services, web applications with instant outage/downtime alerts. With Freshping, companies can efficiently monitor end-points and communicate outages to customers. Our goal is simple: make it effortless for companies to monitor and communicate downtimes to their customers and reduce helpdesk costs.
Freshping's APIs belong to the Representational State Transfer (REST) category. They allow you to perform 'RESTful' operations such as reading, modifying, adding or deleting data from your monitoring dashboard.
What API commands are used by Freshping?
Freshping APIs are plain JSON over HTTP and use the following HTTP verbs:
Note: All API requests should hit the secured endpoint, that is, only HTTPS
Rate Limit
The number of API calls per hour is based on the subscribed plan.
Policies
Freshping APIs are classified into either production or beta APIs. A production API is one that has been made generally available for public use and is stable. A beta API is one that is still in development or is for internal or limited use and whose stability cannot be guaranteed. Beta APIs may be removed or modified at any time without advance notice. The following policies apply to production APIs only.
Deprecation Policy
The current version of production level APIs is v1. When a new version of APIs is made generally available (not beta), the older version will be deprecated and will cease to function after six months. Once an API is removed, any request to it will result in a 404 error.
Breaking Change Policy
Changes that do not break an API, such as adding a new attribute can be made at any time. Changes that break a production level API such as removing attributes or making major changes to the API’s behavior will only be done with an advance notice of 60 days. However, there may be rare occasions where due to legal, performance, or security reasons, we are forced to make breaking changes without advance notice.
Authentication
Authentication is done over Basic Authentication using your organization API key as Username and Freshping subdomain as Password to authenticate the request.
curl -v -u <apikey>:<freshping_subdomain> -H "Content-Type: application/json" -X GET 'https://api.freshping.io/api/v1/'
For example, if your API key is abcdefghij1234567890 and Freshping URL is xyz.freshping.io, the curl command to use is:
curl -v -u abcdefghij1234567890:xyz -H "Content-Type: application/json" -X GET 'https://api.freshping.io/api/v1/checks/'
Note: If you are sure that your credentials are correct, but are still unable to access the APIs, make sure that the "APIkey:X" is Base64-encoded before passing it as an "Authorization" header. |
Where can I find my API key?
Login to your account
Go to settings > Account
Copy API Key
Checks
Check Types
Parameters
List all checks
GET: checks/ |
Response:
{ "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "name": "Example", "status": "AV", "performance_status": null, "alert_note": "", "location": "us-east-1", "alert_users": [1], "alert_contacts": [], "monitoring_interval": 60, "url": "https://example.com", "request_timeout": 30, "basic_auth_username": "", "basic_auth_password": "", "custom_header": {}, "command_string": null, "success_string": null, "error_string": null } ] } |
Get a specific check
GET: checks/<check_id>/ |
Response:
{ "id": 1, "name": "Example", "status": "AV", "performance_status": null, "alert_note": "", "location": "us-east-1", "alert_users": [1], "alert_contacts": [], "monitoring_interval": 60, "url": "https://example.com", "request_timeout": 30, "basic_auth_username": "", "basic_auth_password": "", "custom_header": {}, "command_string": null, "success_string": null, "error_string": null } |
Create a check
POST: checks/ |
Request:
{ "name": "Example", "alert_note": "This is a note", "location": "us-east-1", "alert_users": [1], "alert_contacts": [], "monitoring_interval": 300, "url": "https://example.com", "request_timeout": 30, "basic_auth_username": "", "basic_auth_password": "", "custom_header": {}, "command_string": null, "success_string": null, "error_string": null } |
Response:
{ "id": 1, "name": "Example", "status": "AV", "performance_status": null, "alert_note": "", "location": "us-east-1", "alert_users": [1], "alert_contacts": [], "monitoring_interval": 60, "url": "https://example.com", "request_timeout": 30, "basic_auth_username": "", "basic_auth_password": "", "custom_header": {}, "command_string": null, "success_string": null, "error_string": null } |
Update a check
PATCH: checks/<check_id>/ |
Request:
{ "name": "Example", "alert_note": "This is a note", "location": "us-east-1", "alert_users": [1], "alert_contacts": [], "monitoring_interval": 300, "url": "https://example.com", "request_timeout": 30, "basic_auth_username": "", "basic_auth_password": "", "custom_header": {}, "command_string": null, "success_string": null, "error_string": null } |
Response:
{ "id": 1, "name": "Example", "status": "AV", "performance_status": null, "alert_note": "", "location": "us-east-1", "alert_users": [1], "alert_contacts": [], "monitoring_interval": 60, "url": "https://example.com", "request_timeout": 30, "basic_auth_username": "", "basic_auth_password": "", "custom_header": {}, "command_string": null, "success_string": null, "error_string": null } |
Delete a check
DELETE: checks/<check_id>/ |
Response:
HTTP Status: 204 No Content |
Pause checks in bulk
Parameters
POST: checks/pause/ |
Request:
{ "checks": [1,2] } |
Response:
HTTP Status: 200 OK |
Restart checks in bulk
Parameters
POST: checks/restart/ |
Request:
{ "checks": [1,2] } |
Response:
HTTP Status: 200 OK |
Users
Parameters
List all users
GET: users/ |
Response:
{ "users": [ { "id": 1, "name": "test1", "email": "[email protected]", "role": "Admin", "disable_weekly_report_emails": null, "disable_alert_emails": null, }, { "id": 2, "name": "test2", "email": "[email protected]", "role": "Read Only", "disable_weekly_report_emails": null, "disable_alert_emails": null, } ], "contacts": [ { "id": 1, "name": "test3", "email": "[email protected]" }, { "id": 2, "name": "test4", "email": "[email protected]" } ] } |