Webhook

Data feeds

SMS and other data feeds

Popular communication services can when things happen, i.e., a SMS Text message arrives, offer to trigger a webhook request that could feed data into your CloudBackend database.

share
share

Appliances

A group of Linux type appliances can feed data like system status or real-time data analysis based on artificial intelligence.

Internet of Things (IoT)

Programmable IoT devices using curl, python or similar communication packages, will let you collect data of status and from their smart embedded sensors.

share

Webhook — Client code examples

curl

Example: bash posting a news update - two variants
#!/usr/bin/bash SOURCE=`hostname` curl --request POST \ --header 'Authorization: Bearer API-KEY-SECRET' \ --header 'Content-Type: text/xml' \ --data "<newsfeed>Solsken i ${SOURCE}</newsfeed>" \ https://api.cloudbackend.com/v1/hook/{tenantName}/{webhook_name}/ echo echo ${SOURCE}
 

python

Example: python posting a news update
#!/usr/bin/python3 import requests import subprocess   rootstart= "<newsfeed>" rootend = "</newsfeed>" output = subprocess.check_output(["hostname"], text=True).rstrip('\r\n') message = "Cloudy at " + output payload = rootstart + message + rootend   url = 'https://api.cloudbackend.com/v1/hook/...' headers = {"Authorization": "Bearer API-KEY-SECRET", "Content-Type": "text/xml"}   def post_news(): res = requests.post(url, data=payload, headers=headers) print(res)   post_news()