Lua call Rest API when backup success or fail

I’d like to customize the Lua script report which is called after every backup is done to call a http Rest API.
The call would be a simple HTTP GET call.
How I can do it?

I found that in Alert Scripts there is a PulseWay script which does a similar thing:
local json = require(“dkjson”)
local rc, http_ret, http_code, http_err = request_url(params.api_url … “/systems”, {
method = “POST”,
content_type = “application/json”,
postdata = json.encode (tbl, { indent = true }),
basic_authorization = params.username … “:” … params.password
})

Found how to do it, from the example script in PulseWay.

tbl = {
colore = colore_messaggio,
client = params.clientname,
server = “backup”,
oggetto = subj,
messaggio = messaggio_per_rocket
}

local json = require("dkjson")
local message_to_rocket = json.encode (tbl, { indent = true })
local rc, http_ret, http_code, http_err = request_url("http://localhost:3000/", {
	method = "POST",
	content_type = "application/json",
	postdata = message_to_rocket
})
msg = msg .. message_to_rocket

if rc

–success
then
else
log("HTTP POST to rocket failed with http code "… http_code … ". “…http_err …”. Returning "…http_ret, LL_ERROR)

end