Skip to content

Rest API V2

Paul Cowan edited this page Jul 20, 2014 · 2 revisions

Table of Contents

KegNet Server REST API V2

PING

POST /rest/v2/ping Report client status and temperature

Parameters

Parameter Description Data Type Notes
id Client UUID String UUID form 8-4-4-4-12 for a total of 36 characters
temp Temperature Integer Celsius temperature to 3 decimal places (fahrenheit = temp * .001 * 1.8 + 32)
ts Timestamp Long Unix time in milliseconds
sig Signature String Signature of "id,temp,ts" in base64 (SHA256withRSA)

Response

Status Description Data Type Notes
2xx Success None Message accepted
4xx Client Error None Client was unauthorized or sent an invalid message: do not resend message
5xx Server Error None Server was unable to process the message at this time: retry as appropriate

POUR

POST /rest/v2/pour Report a pour event

Parameters

Parameter Description Data Type Notes
id Client UUID String UUID form 8-4-4-4-12 for a total of 36 characters
pin Flow meter pin Integer GPIO number of the flow meter that recorded the pour
pulses Pulse count Integer Number of pulses recorded by the flow meter
et Elapsed time Long Duration of the pour in milliseconds
ts Timestamp Long Time the pour event occurred, as Unix time in milliseconds
sig Signature String Signature of "id,pin,pulses,et,ts" in base64 (SHA256withRSA)

Response

Status Description Data Type Notes
2xx Success None Message accepted
4xx Client Error None Client was unauthorized or sent an invalid message: do not resend
5xx Server Error None Server was unable to process the message at this time: retry as appropriate
Clone this wiki locally