Authentication

If you want to call any of the following actions when your not logged in you can authenticate with an API key:

  • Append on the URL of your request: &apikey=APIKEY
  • Use POST parameter: "apikey=APIKEY"
  • Add the HTTP header: "Authorization: Bearer APIKEY"

API keys

There are two types of api key the write apikey and read apikey giving read & write access or read-only access. Login or create an account to obtain these keys.

Input API

Available HTML URLs

The input list viewhttps://emoncms.org/input/view

Available JSON commands

Post data

JSON format:https://emoncms.org/input/post?json={power:200}
CSV format:https://emoncms.org/input/post?csv=100,200,300
Assign inputs to a node group (numeric node name)https://emoncms.org/input/post?node=1&csv=100,200,300
Assign inputs to a node group (alpha-numeric node name)https://emoncms.org/input/post?node=emontx&csv=100,200,300
Set the input entry time manuallyhttps://emoncms.org/input/post?time=1500841729&node=1&csv=100,200,300

Note: Both the input/post and input/bulk API's can be used for real-time posting of data and for catching up (such as when an internet connection goes down). Emoncms.org does not however support updating or filling in of historic data after newer data has been written.

APIKEY
To post data from a remote device you will need to include in the request url your write apikey. This give your device write access to your emoncms account, allowing it to post data.

For example using the first json type request above just add the apikey to the end like this:https://emoncms.org/input/post?json={power:200}&apikey=WRITE_APIKEY

Bulk data

You can provide data using bulk modehttps://emoncms.org/input/bulk?data=[[0,16,1137],[2,17,1437,3164],[4,19,1412,3077]]
(with alpha-numeric node names)https://emoncms.org/input/bulk?data=[[0,"emontx",1137],[2,17,1437,3164],[4,19,1412,3077]]
  • The first number of each node is the time offset (see below).
  • The second number is the node id, this is the unique identifer for the wireless node.
  • All the numbers after the first two are data values. The second node here (node 17) has two data values: 1437 and 3164.
  • Optional offset and time parameters allow the sender to set the time reference for the packets. If none is specified, it is assumed that the last packet just arrived. The time for the other packets is then calculated accordingly.
Legacy default format (4 is now, 2 is -2 seconds and 0 is -4 seconds to now):https://emoncms.org/input/bulk?data=[[0,16,1137],[2,17,1437,3164],[4,19,1412,3077]]
Time offset format (-6 is -16 seconds to now):https://emoncms.org/input/bulk?data=[[-10,16,1137],[-8,17,1437,3164],[-6,19,1412,3077]]&offset=-10
Sentat format: (useful for sending as positive increasing time index)https://emoncms.org/input/bulk?data=[[520,16,1137],[530,17,1437,3164],[535,19,1412,3077]]&sentat=543
Absolute time format (-6 is 1387730121 seconds since 1970-01-01 00:00:00 UTC))https://emoncms.org/input/bulk?data=[[-10,16,1137],[-8,17,1437,3164],[-6,19,1412,3077]]&time=1500841729

Input actions

List of inputshttps://emoncms.org/input/list
Delete an inputhttps://emoncms.org/input/delete?id=1

Input process actions

Add an input processhttps://emoncms.org/input/process/add?inputid=1&processid=1&arg=-1&newfeedname=power
List input process listhttps://emoncms.org/input/process/list?inputid=1
Delete input processhttps://emoncms.org/input/process/delete?inputid=1&processid=1
Move input processhttps://emoncms.org/input/process/move?inputid=1&processid=1&moveby=1
Reset input process listhttps://emoncms.org/input/process/reset?inputid=1