This article goes through a step-by-step example of setting up a geofence and testing trigger alerts by sending location data through URL parameters.
Geofence Test
Step 1: Create a Data Bucket
Click the +Cloud icon in the bucket shelf to create a new, empty data bucket.
Step 2: Configure Endpoint Keys (optional)
Two keys are needed to stream data into this new data bucket, the bucket key that you choose (or use the one generated for you) and your access key. Click the "Configure Endpoint Keys" checkbox to set these keys.
Step 3: Get the API Endpoint URL
After the bucket has been created, click on the settings link under the data bucket name on the bucket shelf. The API endpoint URL is located in the data tab.
The URL will look something like this but with the bucketKey and accessKey you chose in Step 2:
https://groker.initialstate.com/api/events?accessKey=8aqrx5GmVoCSCvh9ojV18boUHy5C3SUa&bucketKey=8EUT6VF3KMPD
Step 4: Get a Valid Latitude/Longitude Coordinate
Go to Google Maps (or the map of your choice) and search for a specific location. The latitude/longitude coordinates will be located in the URL. For example, the coordinates for Bridgestone Arena in Nashville, TN are 36.1591779,-86.7806846.
Step 5: Send a Data Point via URL Parameters
Open up a new tab in your browser. Paste the API endpoint URL from step 3 into the address bar. Add &myLocation=36.1591779,-86.7806846 to the end using the latitude/longitude coordinates from Step 4. Hit Enter to send the data point.
Step 6: Tiles Dashboard
Click on the Tiles app to see the data point drawn on an automatically created map tile. This point should correspond to the location selected in Step 4. If a new tile isn't drawn automatically or if the tile isn't drawn as a map by default, something went wrong in Step 5.
Step 7: Setup the Geofence Trigger Condition
Click on the Triggers tab under the data bucket settings. Set the Signal Key to myLocation, the trigger operator to "exits", the radius (km) to 1, and the location to the latitude/longitude coordinate from Step 4. Click the '+' icon to add the trigger condition.
Step 8: Setup the Geofence Trigger Action
Choose the trigger actions to take when the condition is set. Add email and/or SMS alerts and click the '+' to add each alert.
Step 9: Send More Latitude/Longitude Coordinates to Fire the Geofence Trigger
Drag the Google Maps location to get new latitude/longitude coordinates. Send each coordinate via URL parameters as in Step 5. Once a coordinate has been sent that is greater than 1 km from the geofence center location, your trigger actions will fire.
Step 10a: The Geofence Trigger SMS Alert
A preview image containing the geofence center location and the location that triggered the alert will be sent via a URL (e.g. https://init.st/lww6h1u) in the SMS.
Step 10b: The Geofence Trigger Email Message
A similar email message will be sent when the geofence trigger fires.
Comments
0 comments
Article is closed for comments.