Skip to content

How does push monitor works is there an example using curl?Β #201

@filipiff

Description

@filipiff

Hi, congratulations for the nice work!
Unfortunately I didn't find any documentation or help on how to use push monitor. So I tried using curl with following sysntax but I allways get the following answer : {"message":"Monitor does not exist"}

Here is the code I tried in bash:

curl \
  -X POST http://<ip>:2308/api/push \
  -H "Content-Type: application/json" \
  -d '{
     "token": "<my-push-token>",
     "status": "online",
     "message": "Service is now Ok",
     "latency": 100 }' 

In the logs I get the following error:

error: Error handler {"error":"Monitor does not exist","service":"bot","stack":"UnprocessableError: Monitor does not exist\n    at fetchUsingUrl (file:///app/server/database/queries/monitor.js:133:11)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async createPushHeartbeat (file:///app/server/middleware/createPushHeartbeat.js:13:21)","timestamp":1770313606366} 

Anyone have some hint? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions