This is the ID of your Device. You find this in the URL of the Datacake Portal and on the Device-View.
Rate Limiting
Per default the Datacake GraphQL-API has an internal rate limiting of 1 write per second and per field. If you want to record historical data this might be an issue.
Examples
Here you find some Examples that show you how to record multiple measurements.
// Set device_id to serial-number of Datacake API Device
device_id = "be525e29-4398-4fc1-a928-dead7fdfe218";
// Set Token to your personal access token or individual token
token = "put your token in here";
// This is the API Information for the HTTP Request Node
url = "https://api.datacake.co/v1/devices/"+device_id+"/record/?batch=true"
// Create Header for Node-RED HTTP Node
headers = {
"Authorization": "Token "+token,
"Content-Type": "application/json"
};
// Now we are going to create the Payload we forward to Datacake API
payload = [
{
"field": "WATT",
"value": msg.payload.watt
},
{
"field": "AMPERE",
"value": msg.payload.ampere
},
{
"field": "VOLT",
"value": msg.payload.volt
}
];
// Return it - were all set!
return msg;