Heartbeats

List heartbeats

List heartbeats on a site.

GET /api/site/{id}/heartbeats

Example request :

curl "https://cloud.boxydev.com/api/site/1/heartbeats" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "data": [
        {
            "id": 1,
            "name": "test",
            "duration": 10,
            "checked_at": "2022-10-20T20:59:39.000000Z",
            "created_at": "2022-10-16T20:59:39.000000Z"
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/site/1/heartbeats?page=1",
        "last": "https://cloud.boxydev.com/api/site/1/heartbeats?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/site/1/heartbeats",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get heartbeat

Show a heartbeat.

GET /api/heartbeat/{id}

Example request :

curl "https://cloud.boxydev.com/api/heartbeat/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "name": "test",
    "duration": 10,
    "checked_at": "2022-10-20T20:59:39.000000Z",
    "created_at": "2022-10-16T20:59:39.000000Z"
}

Create heartbeat

Create a heartbeat.

POST /api/site/{id}/heartbeat

Parameters :

Parameter Description
name The heartbeat name.
duration The heartbeat duration.

Example request :

curl "https://cloud.boxydev.com/api/site/1/heartbeat" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "test",
        "duration": 10
    }'

Example response :

{
    "id": 1,
    "name": "test",
    "duration": 10,
    "checked_at": "2022-10-20T20:59:39.000000Z",
    "created_at": "2022-10-18T22:22:19.000000Z"
}

Delete heartbeat

Delete a heartbeat.

DELETE /api/heartbeat/{id}

Example request :

curl -X DELETE "https://cloud.boxydev.com/api/heartbeat/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"