Skip to content

Rest API V1

Paul Cowan edited this page Dec 13, 2013 · 1 revision

Table of Contents

KegNet Server REST API

PING

POST /rest/v1/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 Integer Unix time in seconds
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/v1/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 Integer Duration of the pour in seconds
ts Timestamp Integer Time the pour event occurred, as Unix time in seconds
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