API
Uptime Checks
Note: for each endpoint listed here, you'll need to provide your bearer token in the Authorization header when making requests.
Example:
Authorization: Bearer token-goes-here
Create Uptime Check
POST https://api.onlineornot.com/v1/checks/
Required parameters
Name | Description | Constraints |
---|---|---|
name (string) | a human-readable name for your uptime check | |
url (string) | a URL to check | Must be a valid URL starting with http:// or https:// |
cURL
curl -X GET "https://api.onlineornot.com/v1/checks" \ -H "Authorization: Bearer token-goes-here" \ -H "Content-Type:application/json" \ -d '{ "name": "check-name-here", "url": "valid-url-to-check-here" }'
Response
Success
{ "success": true, "result": { "id": "identifier-goes-here", "name": "OnlineOrNot Home", "url": "https://onlineornot.com/", "status": "ONLINE", // enum: "ONLINE"| "OFFLINE" | null "lastQueued": "2023-02-06T08:05:00.000Z" }, "errors": [], "messages": []}
Error
Default:
{ "success": false, "result": null, "errors": [{ "code": 10001, "message": "Issue fetching data", "type": null }], "messages": []}
Unauthenticated:
{ "success": false, "result": null, "errors": [{ "code": 10002, "message": "Unauthenticated", "type": null }], "messages": []}
Unauthorized:
{ "success": false, "result": null, "errors": [{ "code": 10003, "message": "Unauthorized", "type": null }], "messages": []}
Plan limit reached:
{ "success": false, "result": null, "errors": [ { "code": 10004, "message": "Plan limit reached - please upgrade your plan to add more uptime checks", "type": null } ], "messages": []}
List Uptime Checks
GET https://api.onlineornot.com/v1/checks
Required parameters
Name | Description | Constraints |
---|---|---|
Identifier (string) | Your uptime check's ID. You can find the identifier in the URL of your uptime check at OnlineOrNot.com. |
Optional parameters
Name | Description | Constraints |
---|---|---|
page (number) | Page number of paginated results. | default value: 1 |
per_page (number) | Number of results to fetch per page. | default value: 10 |
cURL
curl -X GET "https://api.onlineornot.com/v1/checks" \ -H "Authorization: Bearer token-goes-here" \ -H "Content-Type:application/json"
Response
Success
{ "success": true, "result": [ { "id": "identifier-goes-here", "name": "OnlineOrNot Home", "url": "https://onlineornot.com/", "status": "ONLINE", // enum: "ONLINE"| "OFFLINE" | null "lastQueued": "2023-02-06T08:05:00.000Z" } //...9 more results here ], "result_info": { "page": 1, "per_page": 10, "count": 10, "total_count": 21 }, "errors": [], "messages": []}
Error
{ "success": false, "result": null, "errors": [{ "code": 10001, "message": "Issue fetching data", "type": null }], "messages": []}
View Uptime Check
GET https://api.onlineornot.com/v1/checks/{identifier}
Required parameters
Name | Description | Constraints |
---|---|---|
Identifier (string) | Your uptime check's ID. You can find the identifier in the URL of your uptime check at OnlineOrNot.com. |
cURL
curl -X GET "https://api.onlineornot.com/v1/checks/identifier-goes-here" \ -H "Authorization: Bearer token-goes-here" \ -H "Content-Type:application/json"
Response
Success
{ "success": true, "result": { "id": "identifier-goes-here", "name": "OnlineOrNot Home", "url": "https://onlineornot.com/", "status": "ONLINE", // enum: "ONLINE"| "OFFLINE" | null "lastQueued": "2023-02-06T08:05:00.000Z" }, "errors": [], "messages": []}
Error
{ "success": false, "result": null, "errors": [{ "code": 10001, "message": "Issue fetching data", "type": null }], "messages": []}
Delete Uptime Check
DELETE https://api.onlineornot.com/v1/checks/{identifier}
Required parameters
Name | Description | Constraints |
---|---|---|
Identifier (string) | Your uptime check's ID. You can find the identifier in the URL of your uptime check at OnlineOrNot.com. |
cURL
curl -X DELETE "https://api.onlineornot.com/v1/checks/identifier-goes-here" \ -H "Authorization: Bearer token-goes-here" \ -H "Content-Type:application/json"
Response
Success
{ "success": true, "result": { "id": "identifier-goes-here" }, "errors": [], "messages": []}
Error
No token:
{ "success": false, "result": null, "errors": [ { "code": 10002, "message": "Unauthenticated", "type": null } ], "messages": []}
Invalid token (wrong permissions):
{ "success": false, "result": null, "errors": [ { "code": 10003, "message": "Unauthorized", "type": null } ], "messages": []}