{"_id":"56b514db5997532100bc6bf0","parentDoc":null,"__v":0,"githubsync":"","project":"563bcb6b2eecbf0d003c5b73","user":"563bcb458a9ce40d00eea1ae","editedParams":true,"editedParams2":true,"category":{"_id":"56b510327bccae0d00e9a1a5","pages":["56b510ee5997532100bc6be9","56b514db5997532100bc6bf0","56b5166e99c8d30d00f55870"],"__v":3,"project":"563bcb6b2eecbf0d003c5b73","version":"563bcb6c2eecbf0d003c5b76","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-05T21:12:18.778Z","from_sync":false,"order":4,"slug":"for-developers","title":"For Developers"},"version":{"_id":"563bcb6c2eecbf0d003c5b76","project":"563bcb6b2eecbf0d003c5b73","__v":8,"createdAt":"2015-11-05T21:34:36.022Z","releaseDate":"2015-11-05T21:34:36.022Z","categories":["563bcb6c2eecbf0d003c5b77","5661fa5355e4450d00e62c64","5661fa63b401c70d00dde776","5668931d8639090d00759424","56a25e530aefae0d00b7fe33","56a2844ed00f7d0d00c8f072","56b4fe0a6874f40d00f02bcc","56b510327bccae0d00e9a1a5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-05T21:32:11.372Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -d '{\"sensor_id\":\"XXXXXX\",\"api_id\":\"XXXXXX\",\"api_key\":\"XXXXXX\",\"watts\":1003}' http://www.wattvision.com/api/v0.2/elec","language":"shell"}]},"method":"post","results":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"56b514db5997532100bc6bf6","ref":"","in":"body","required":true,"desc":"(Required, JSON string) The sensor id with which the uploaded data will be associated. Must be authorized at the API Settings Page.","default":"","type":"string","name":"sensor_id"},{"_id":"56b514db5997532100bc6bf5","ref":"","in":"body","required":true,"desc":"(Required, JSON string) the api id that authorizes this data upload. Found on API Settings Page.","default":"","type":"string","name":"api_id"},{"_id":"56b514db5997532100bc6bf4","ref":"","in":"body","required":true,"desc":"(Required, JSON string) the api key that authorizes this data upload. Found on API Settings Page.","default":"","type":"string","name":"api_key"},{"_id":"56b514db5997532100bc6bf3","ref":"","in":"body","required":true,"desc":"(Optional, JSON string) the UTC ISO format date time (YYYY-MM-DDTHH:MM:SS) associated with the uploaded data, if not provided server time is used","default":"","type":"string","name":"time"},{"_id":"56b514db5997532100bc6bf2","ref":"","in":"body","required":false,"desc":"(JSON number) a float value of a watts measurement","default":"","type":"string","name":"watts"},{"_id":"56b514db5997532100bc6bf1","ref":"","in":"body","required":false,"desc":"(JSON number) a float value of the watthours consumed since the sensor started recording data (for a house that does not put energy back to the grid this number is a monotonically increasing function of time, but it doesn't have to be.)","default":"","type":"string","name":"watthours"}],"url":"/elec"},"isReference":false,"order":2,"body":"Your [API Settings Page can be found here](https://www.wattvision.com/usr/api).\n\n## HTTP POST\nThe parameters are passed as part of the body of the POST request. We expect a JSON object with each of the following properties, some of which are optional. Note that JSON strings are enclosed by double quotes and numbers are not.\n\nHere is some [sample code](https://github.com/wattvision/api_client).\n\n**You'll need to upload one or both of 'watts' or 'watthours'.\n*for full tracking, you'll need to upload both, we don't auto-convert between types** \n\n## Update Strategy\nIf you want to have your sensor showing as \"sensor active\" you must consistently upload faster than once every 5 minutes.\n\n## Response Codes\nYou will receive a 400 Bad Request if the request is not in the correct format, 200 on successful POST.","excerpt":"","slug":"upload-data-to-wattvision","type":"endpoint","title":"Upload Data to Wattvision"}

postUpload Data to Wattvision


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

sensor_id:
required
string
(Required, JSON string) The sensor id with which the uploaded data will be associated. Must be authorized at the API Settings Page.
api_id:
required
string
(Required, JSON string) the api id that authorizes this data upload. Found on API Settings Page.
api_key:
required
string
(Required, JSON string) the api key that authorizes this data upload. Found on API Settings Page.
time:
required
string
(Optional, JSON string) the UTC ISO format date time (YYYY-MM-DDTHH:MM:SS) associated with the uploaded data, if not provided server time is used
watts:
string
(JSON number) a float value of a watts measurement
watthours:
string
(JSON number) a float value of the watthours consumed since the sensor started recording data (for a house that does not put energy back to the grid this number is a monotonically increasing function of time, but it doesn't have to be.)

Examples


Documentation

Your [API Settings Page can be found here](https://www.wattvision.com/usr/api). ## HTTP POST The parameters are passed as part of the body of the POST request. We expect a JSON object with each of the following properties, some of which are optional. Note that JSON strings are enclosed by double quotes and numbers are not. Here is some [sample code](https://github.com/wattvision/api_client). **You'll need to upload one or both of 'watts' or 'watthours'. *for full tracking, you'll need to upload both, we don't auto-convert between types** ## Update Strategy If you want to have your sensor showing as "sensor active" you must consistently upload faster than once every 5 minutes. ## Response Codes You will receive a 400 Bad Request if the request is not in the correct format, 200 on successful POST.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}