Sensor Interaction

Basic Request/Response

GET https://hithub.io/sensor/222/hit

Create an event by making a simple GET request using your sensor's ID. Such a request would result in one of the following responses.

HTTP Code Explanation
200 Request received
400 Invalid sensor was specified
401 Required api token not found or invalid (optionally setup by the user)
423 Either 1. Sensor is currently locked according to the reset timeout (optionally setup by the user) or 2. The sensor's status is set to inactive.
429 Account associated with the specified sensor has exceeded the number of allowed event requests per hour.
504 Timeout upstream from Google Analytics server (optionally setup by user)

Custom Variables

You may pass up to 3 variables in an event hit request. These values can contain letters or numbers, but cannot exceed a string length of 10 characters. These values can be evaluated by your alarms. Variables may be passed in the following format:

GET https://hithub.io/sensor/222/hit?var1=abc&var2=123&var3=xyz

Require Sensor Tokens

You may set any of your sensors to require a token in order for an event to be created. If a token isn't required, anyone could potentially create events for your sensors.

You can choose between requiring an account token or a user token. The difference is only applicable to multi-user setups. Account tokens will be known to all users who have access to the account. User tokens are only known to specific users. Use the following format to specify a token:

GET https://hithub.io/sensor/222/hit?token=YOURTOKEN

If the account token is required, it will be shown with the URL for that sensor in your sensor list. You may find your user token on your User Profile page.

Rate Limits

All accounts are subject to rate limits based on the account's plan. When you pick a plan, you'll see a "max events per hour" value. If within a one hour time period your account receives a number of events exceeding that value, a HTTP 429 response will be returned for any new event request over the following hour.

You can throttle the number of events your sensors attempt to create by setting an appropriate "Reset Time" value for any sensor. When this is implemented with, say a value of 5 minutes, the sensor will be locked for 5 minutes after an event is created. During this time, HTTP 423 responses will be sent for any new hit attempts.

Did we miss something?

If something is not clear, please contact us

Copyright © 2015 HitHub. All Rights Reserved.