GET/v1/checks

List all checks

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Optional parameters

  • Name
    page
    Type
    string
    Description

    Page number of paginated results.

    Default: "1"

  • Name
    per_page
    Type
    string
    Description

    Number of items per page.

    Default: "20"

Responses

StatusMeaningDescription
200OKReturns a list of OnlineOrNot Checks
500Internal Server ErrorInternal Server Error

Response Schema

Status Code 200

NameTypeRequiredDescription
» result[object]truenone
»» idstringtrueUptime Check ID
»» namestringtrueName of the check
»» urlstring(uri)trueURL to check
»» statusstring,nulltrueStatus of the check
»» last_queuedstringtrueLast time the check was queued
» result_infoobjecttruenone
»» pagenumberfalsePage number of paginated results.
»» per_pagenumberfalseNumber of items per page.
»» countnumbertrueNumber of items on the current page.
»» total_countnumbertrueTotal number of items.
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Enumerated Values

PropertyValue
statusONLINE
statusOFFLINE

Request

GET
/v1/checks
curl --request GET \
  --url https://api.onlineornot.com/v1/checks \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": [
    {
      "id": "a1b2c3d4",
      "name": "My landing page",
      "url": "https://example.com",
      "status": "ONLINE",
      "last_queued": "2021-01-01T00:00:00.000Z"
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}

POST/v1/checks

Create a check

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Required parameters

  • Name
    » name
    Type
    string
    Description

    Name of the check

  • Name
    » url
    Type
    string(uri)
    Description

    URL to check

Optional parameters

  • Name
    body
    Type
    object
    Description

    undefined

  • Name
    » text_to_search_for
    Type
    string
    Description

    Text to search for in the response

  • Name
    » test_interval
    Type
    integer
    Description

    Interval in seconds between checks

  • Name
    » number_of_fails_before_alert
    Type
    integer
    Description

    Number of failing checks before an alert is sent

    Default: 2

  • Name
    » type
    Type
    string - enum
    Description

    Type of check

    Default: "UPTIME_CHECK"
    Enum: "UPTIME_CHECK" "BROWSER_CHECK"

  • Name
    » alert_priority
    Type
    string - enum
    Description

    Alert Priority

    Default: "LOW"
    Enum: "LOW" "HIGH"

  • Name
    » headers
    Type
    object
    Description

    Headers to send with the request

  • Name
    »» **additionalProperties**
    Type
    string
    Description

    Header value

  • Name
    » method
    Type
    string - enum
    Description

    HTTP Method

    Default: "GET"
    Enum: "GET" "HEAD" "POST" "PUT" "PATCH" "DELETE"

  • Name
    » body
    Type
    string
    Description

    undefined

  • Name
    » follow_redirects
    Type
    boolean
    Description

    Whether to follow redirects

    Default: true

  • Name
    » assertions
    Type
    object
    Description

    undefined

  • Name
    »» **additionalProperties**
    Type
    string
    Description

    undefined

  • Name
    » verify_ssl
    Type
    boolean
    Description

    Whether to fail a check if SSL verification fails

  • Name
    » auth_username
    Type
    string
    Description

    Username to use for URLs behind HTTP Basic Auth

  • Name
    » auth_password
    Type
    string
    Description

    Password to use for URLs behind HTTP Basic Auth

Body parameter

{
  "name": "My landing page",
  "url": "https://example.com",
  "text_to_search_for": "Example Domain",
  "test_interval": 60,
  "number_of_fails_before_alert": 2,
  "type": "UPTIME_CHECK",
  "alert_priority": "LOW",
  "headers": {
    "X-My-Header": "My Value"
  },
  "method": "GET",
  "body": "Hello World",
  "follow_redirects": true,
  "assertions": {
    "property1": "string",
    "property2": "string"
  },
  "verify_ssl": false,
  "auth_username": "username",
  "auth_password": "password"
}

Responses

StatusMeaningDescription
200OKCreate a new OnlineOrNot Check
500Internal Server ErrorInternal Server Error

Response Schema

Status Code 200

NameTypeRequiredDescription
» resultobjecttruenone
»» idstringtrueUptime Check ID
»» namestringtrueName of the check
»» urlstring(uri)trueURL to check
»» statusstring,nulltrueStatus of the check
»» last_queuedstringtrueLast time the check was queued
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Enumerated Values

PropertyValue
statusONLINE
statusOFFLINE

Request

POST
/v1/checks
curl --request POST \
  --url https://api.onlineornot.com/v1/checks \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"My landing page","url":"https://example.com","text_to_search_for":"Example Domain","test_interval":60,"number_of_fails_before_alert":2,"type":"UPTIME_CHECK","alert_priority":"LOW","headers":{"X-My-Header":"My Value"},"method":"GET","body":"Hello World","follow_redirects":true,"assertions":{"property1":"string","property2":"string"},"verify_ssl":false,"auth_username":"username","auth_password":"password"}'

Response

{
  "result": {
    "id": "a1b2c3d4",
    "name": "My landing page",
    "url": "https://example.com",
    "status": "ONLINE",
    "last_queued": "2021-01-01T00:00:00.000Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/checks/{check_id}

Retrieve a check

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Required parameters

  • Name
    check_id
    Type
    string
    Description

    Uptime Check ID

Responses

StatusMeaningDescription
200OKRetrieve the specified OnlineOrNot Check
500Internal Server ErrorInternal Server Error

Response Schema

Status Code 200

NameTypeRequiredDescription
» resultobjecttruenone
»» idstringtrueUptime Check ID
»» namestringtrueName of the check
»» urlstring(uri)trueURL to check
»» statusstring,nulltrueStatus of the check
»» last_queuedstringtrueLast time the check was queued
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Enumerated Values

PropertyValue
statusONLINE
statusOFFLINE

Request

GET
/v1/checks/{check_id}
curl --request GET \
  --url https://api.onlineornot.com/v1/checks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4",
    "name": "My landing page",
    "url": "https://example.com",
    "status": "ONLINE",
    "last_queued": "2021-01-01T00:00:00.000Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

DELETE/v1/checks/{check_id}

Delete a check

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Required parameters

  • Name
    check_id
    Type
    string
    Description

    Uptime Check ID

Responses

StatusMeaningDescription
200OKReturns the deleted OnlineOrNot Check's ID
500Internal Server ErrorInternal Server Error

Response Schema

Status Code 200

NameTypeRequiredDescription
» resultobjecttruenone
»» idstringtrueUptime Check ID
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Request

DELETE
/v1/checks/{check_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/checks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?