This action has been deprecated and must be replaced by the new REST API action which provide more configuration options.
This action allows performing a request (POST only) to an external API.
For secure requests (HTTPS), the certificate handshaking is automatically performed by Servitly, for this reason, a certificate based on a public CA must be used, so self-signed certificates are not supported.
The endpoint can contain query string parameters (e.g. apiKey), note that the URL is invoked from the Servitly backend, so it must be reachable from the cloud.
The POST body will include all the information about the thing, automation, and measure.
Optionally, the basic HTTP authentication can be used by specifying the username and password.
Here is a JSON payload sent to the callback URL when the automation is triggered.
{ "alert": { "severity": "FAILURE", "duration": "7845", "activatedTime": "1581517331499", "description": "The oven is offline", "activatedTimeFormattedTZ": "2020-02-12 14:22:11[UTC]", "title": "Oven offline", "activatedTimeFormatted": "2020-02-12 14:22:11[UTC]", "durationFormatted": "7s" }, "thing": { "serialNumber": "OVEN-002", "gpsPosition": "45.687400, 9.025605", "name": "OVEN-002", "id": "5d5ea24463342200076a3c53", "serviceLevel": "Pay-per-use", "properties": { "networkInterface": "WIFI", "serviceDueDate": "1590662457621" } }, "thingDefinition": { "name": "Oven-1200w", "id": "5c795c602074420008bcd6ef", "properties": { "model": "1200W" } }, "location": { "country": "Italy", "gpsPosition": "45.655769,8.4920926", "name": "Sweet Life", "id": "5aeae7f34e22a20006f6145c", "properties": { "phoneNumber": "+39 02 125458965", "address": "via Della Stazione, 10", "city": "Fontaneto D'agogna" } }, "customer": { "country": "Italy", "name": "Sweet Bakery", "id": "5aeae7ee2ce57500072b9e65", "properties": { "phoneNumber": "+39 02 125458965", "vatNumber": "5674568901" } }, "partner": { "country": "Italy", "code": "12484566", "timezone": "Europe/Rome", "name": "Oven Service", "id": "5cf5270f2d4d4a0008f5a27c", "properties": { "phoneNumber": "+39 02 23564158", "gpsPosition": "45.457787, 9.171554", "address": "via Ausonio, 21", "city": "Milano", "vatNumber": "12567842695429" } }, "metrics": {}, "timestamp": "1581517339344", "rule": { "name": "test", "id": "5e440967c5f85100010ceb5f", "event": "ON_ALERT_ACTIVATED" }, "action": { "name": "test" } }
The payload structure is fixed, but the attributes depend on the properties that have been configured on the various objects.
The alert node is present only in case the automation is based on alert event.
Comments
0 comments
Please sign in to leave a comment.