+48
Started

Web Hooks for integration with popular apps and services

jeff 9 years ago updated by Анастасия Куб 1 year ago 18

Many popular cloud-based applications and services offer web hooks that get triggered when events take place. Would like the ability to associate those web hooks with the creation of a chat message in Ryver. Ideally, Ryver would have built-in message formatting support for a bunch of popular services, rather than requiring custom implementation.

I'm curious what "popular services" would be started with? Or would it be easier to have a chat command trigger a particular integration rather than waiting on an automatic trigger like Zapier?

+2

Hi Stephanie. We're just about to get started on this feature. We'll start by adding the generic support for webhooks and associated templates for transforming the data into messages. Then we'll identify a set of products like Github, Jira, etc. to create templates for. Once we come up with the initial planned list, I'll post them here. If you have any favorites, please do share!

Please consider beyond software tools for integrations. My office doesn't do any software development, so that wouldn't be helpful. You already support Google Drive & Hangouts integrations as well as Box, so the bulk of our immediate needs are met. Project Management software integrations would be useful, as would Google Calendar integration - although perhaps those will be coming with Ryver Tasks?

Looking forward to this feature guys! It'll make Ryver much easier to integrate with and configure.

Hi Jeff, has there been any movement on this? We are considering implementing River, but the lack of integrations is an issue (particularly Jira & Bitbucket for us). As a fallback, has there been any movement on finalising the webhook API with anything other than basic auth? (as descibed here: https://support.ryver.com/chatmessage-api/).

I don't see Zapier as an acceptable solution, as the cost adds up quickly.

+1

We finally have initial webhook support running internally and will be rolling it out in a little over a week!

If this is true I'll be moving everthing to Ryver as soon as I can convert my Slack webhooks over.

I think some integration with gmail (actually any forward capable email app) where maybe we can set a filter in gmail to forward certain email to my dedicated address in my ryver account that will automatically add a custom message to a forum. This will be useful for contacts that come in from my website. If we could do something similar for messages in fb pages it would be awesome.

Finally first webhook made and works awesome! Ryver just became even more useful!

Webhooks are still not working with Github, which I still cannot use Ryver until this is available.

+1

We have one incredible webhook setup for our webservers. Webhook is from https://uptimerobot.com to Ryver and it notifies us when a server is down. Incredible free service.

Having plugged this free service enough now ;) , I am very interested in any user webhooks from let's say services like Asana vs Ryver (Yes we have tried Zapier, but somewhat limited in 100 a month every 15 minutes).

Would you care to share how you managed to link uptime robot and ryver please? :)

Created a short how-to, hopefully it will help you on your way: http://blueocean.clarify-it.com/d/26e7a3

Markus, you can use built in commands to display any info you want. I have a cron that runs twice a day and shows me my raid status for all my web servers. It utilizes the mdstat but i have others that use fdisk, uptime, ls, any many more. You can use PHP to dump all the data and then post it to ryver. 


This forum is not really "code" friendly so i am not sure how this will turn out (formatting i am sure will be busted)...


$raidURL = 'https://{YOUR_ORGANIZATION}.ryver.com/application/webhook/{YOUR_KEY}';

$serverList = array('SERVER_1' => 'SERVER_ADDR_1', 
'SERVER_2' => 'SERVER_ADDR_2');

foreach ($serverList as $server => $url)
{
$raw = file_get_contents($url .'/serverStatus.php?cmd=mdstat');
$xml = simplexml_load_string($raw);
$serverStatus = (array) $xml;

$driveResult = display_mdstat($serverStatus['MDSTAT']);

$payLoad .= $server ."\r\n";
$payLoad .= "```\r\n". str_replace('<br>', "\r\n", $driveResult) ."\r\n```";
$payLoad .= "\r\n";
}

$result = postRyverWebhook($raidURL, $payLoad);

function postRyverWebhook($url, $msg)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1");
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'body='. urlencode($msg));
$result = curl_exec($ch);
curl_close($ch);

if ($result === false) 
{
return 'Curl error: ' . curl_error($ch);
}
return $result;
}

function display_mdstat($raw)
{
$raw = (array) $raw;

foreach ($raw as $item => $line)
{
$array[] = $line;
}

for ($x = 0; $x < count($array); $x++)
{
$thisLine = $array[$x];

if (strstr($thisLine, 'active'))
{
$clean .= trim($array[$x]) .' - '. trim($array[$x+1]) .'<br>';
}
}
return $clean;
}


function display_serials($raw)
{
$raw = (array) $raw;
$array = (array) json_decode($raw[0]);

foreach ($array as $index => $obj)
{
if (trim($obj->PARTITION) && trim($obj->SERIAL) && trim($obj->MODEL))
{
$clean .= $obj->PARTITION .' - '. $obj->SERIAL .' ['. $obj->MODEL .']<br>';
}
}
return $clean;
}


function display_uptime($raw)

{
$raw = (array) $raw;

foreach ($raw as $item => $line)
{
$array[] = $line;
}

$clean = $array[0];

return $clean;
}


And in the serverStatus.php file you have the commands



switch($_GET['cmd'])
{
case 'mdstat':
exec("cat /proc/mdstat", $mdstat);
break;

case 'fdisk':
exec("sudo fdisk -l", $fdisk);
break;

case 'uptime':
exec("uptime", $uptime);
break;

case 'lsblk':
exec("sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL", $lsblk);
break;

case 'ls':
exec("ls /dev/sd?", $lsDrives);
break;

default:
exec("cat /proc/mdstat", $mdstat);
exec("sudo fdisk -l", $fdisk);
exec("uptime", $uptime);
exec("sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL", $lsblk);
exec("ls /dev/sd?", $lsDrives);
break;
}


if ($lsDrives)
{
foreach ($lsDrives as $index => $partition)
{
unset($hdparm);
exec("sudo hdparm -I ". $partition ." | grep -e \"Serial Number\" -e \"Model Number\"", $hdparm);
$model = trim(str_replace('Model Number: ', '', $hdparm[0]));
$serial = trim(str_replace('Serial Number: ', '', $hdparm[1]));

if (strlen($model) > 5 && strlen($serial) > 5)
{
$serialNumbers[] = array('PARTITION' => $partition, 'MODEL' => $model, 'SERIAL' => $serial);
}
}
}

$data = array('MDSTAT' => $mdstat, 'FDISK' => $fdisk, 'UPTIME' => $uptime, 'LSBLK' => $lsblk, 'SERIALS' => json_encode($serialNumbers));
$xml = new SimpleXMLElement('<serverStatus />');
to_xml($xml, $data);
print $xml->asXML();

function to_xml(SimpleXMLElement $object, array $data)
{   
    foreach ($data as $key => $value)
    {   
        if (is_array($value))
        {   
            $new_object = $object->addChild($key);
            to_xml($new_object, $value);
        }   
        else
        {
if (is_numeric($key))
{
$key = 'item_'. $key;
}

            $object->addChild($key, $value);
        }   
    }   


So your web user will need SUDO access to run these commands. Quite simple and the possibilities of data you can be posting automatically are pretty much endless. Anyways, just some example code that will hopefully help others who manage servers and want to add some automation in there.

I need to integrate evernote inside ryver as a slack: creating a note, find a note and clip conversation.
Anyone knows how to do that? I try with zapier, but I cant.


Tks

Este ușor să fii de acord că, cazinourile online pot fi atât bune, cât și rele pentru portofelul tău. Conform recenziilor sincere, cazinoul Vulkan Vegas stă în picioare de o perioadă destul de lungă de timp. conform statisticilor, acest cazinou online are cel mai mare https://romania-vulkanvegas.com/ RTP.