Notifications & Webhooks

From Airangel Wiki
Jump to: navigation, search

Notifications (Alerts) can be setup to trigger emails or webhooks when certain criteria, defined by the system user, are met by networks users/guests. Notifications can be setup to trigger based on the following criteria:

  • Marketing Hits
  • Revenue
  • Account Whereabout (location)
  • Location Density
  • Unique Devices
  • Guest Data
  • Login Attempt
  • Guest Data Post

Webhooks

Webhooks are essentially a push notification that can push data out of the Airangel platform in real time. They are useful if there is a third party system (e.g. a CRM system) that needs data from the Guest WiFi network pushed into it.

Example Webhook

Social Login Data with Facebook

https://webhook.service/newlogin?site=SITEID&user=1394576374171799%40facebook&mac=00-11-22-33-44-55-66&locale=en_GB&gender=male&mail=anton%40airangel.com&firstname=john&lastname=van%20damme&fb_url=https%3A%2F%2Fwww.facebook.com%2Fapp_scoped_user_id%2F1394576374171799%2F

Broken down this is:

  • '''https://webhook.service/newlogin?''' => the configured server where the webhook is sent
  • site=SITEID => configured site id (initially this is statically added to the webhook URL)
  • user=1394576374171799%40facebook => the username (facebook unique id) + @facebook (this would change as per social provider e.g. 1234@twitter for twitther auth)
  • mac=00-11-22-33-44-55-66 => MAC address of the client
  • locale=en_GB => The locale returned by facebook
  • gender=male => Gender returned by facebook
  • mail=john%40airangel.com => email address returned by facebook
  • firstname=john => firstname returned by facebook
  • lastname=van%20damme => last name returned by facebook
  • fb_url=https%3A%2F%2Fwww.facebook.com%2Fapp_scoped_user_id%2F1394576374999999%2F => URL to the facebook profile

The request is sent as a GET request with urlencoded values according to RFC 1738 (raw url encode)

Example Device-Info Webhook

This example text used with a "Login attempt" type of webhook would send a webhook useful for Chromecast/Apple TV association:

https://service-host/login?site=MySite&mac={MAC}&room={room}&login={status}

This will post to the remote service with the room and MAC and the login status.

Parameter Usage
site Site code, configured statically per site for your reference.
mac MAC address of the device logging in.
room Room number associated with the PMS login.
login Login status - 0 = fail, 1 = success. Discard 0 values at the remove service.