This REST R2D2Bot web service allows you to work with a Telegram Bot for system notification
Returns information about R2D2Bot
curl -v --insecure https://admin:admin@localhost:7232/info
> GET /info HTTP/1.1
> Host: localhost:7232
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.68.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 347
< Content-Type: application/json
< Server: R2D2Bot/1.03
< Date: Sat, 09 Oct 2021 05:59:52 GMT
<
{
"generated": "2021-10-09 05:57:39 GMT",
"message": "Ok",
"ok": true
}
Format of the JSON response:
generated
is date of response in GMT [optioanal]message
is a response message or text of errorok
is the boolean statusThe method allows you to process the receipt of data from the Telegram server
curl -v --insecure -X POST \
-H 'Content-Type: application/json' \
-d '{"message": {"text": "This is a test from curl"}}' \
https://admin:admin@localhost:7232/trap/
> POST /trap/ HTTP/1.1
> Host: localhost:7232
> Authorization: Basic YWRtaW46YWRtaW4=
> Content-Type: application/json
> User-Agent: curl/7.68.0
> Content-Length: 49
>
< HTTP/1.1 200 OK
< Content-Length: 80
< Content-Type: application/json
< Server: R2D2Bot/1.03
< Date: Tue, 16 Nov 2021 16:45:43 GMT
<
{
"generated": "2021-11-16 16:45:43 GMT",
"message": "Ok",
"ok": true
}
Format of the JSON response:
generated
is date of response in GMT [optioanal]message
is a response message or text of errorok
is the boolean status