Report energy consumption data to Arkreen Network.
POST https://api.arkreen.com/v1
Content-Type: application/json
authorization: Bearer 0x0000000000000000000000000000000000000000000000000000000000000000
{
"jsonrpc": "2.0",
"id": 1,
"method": "edr_reportConsumeData",
"params": {
"clientId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"power": 1,
"energy": 0
}
}
The params
is a JavaScript
object, its field include:
Field | Exists | Type | Description |
---|---|---|---|
clientId |
required | String |
Unique client Id that Arkreen issued to API Miner |
power |
required | Number |
Real-time power consumption, Unit: milliwatt |
energy |
required | Number |
Cumulative power consumption, Unit: milliwatt hours |
{
"jsonrpc": "2.0",
"id": 1,
"result": "OK"
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 1000,
"message": "Invalid authorization token"
}
}
Except the Common Error Codes, this method has a lot of dedicated error codes:
Code | Message | Meaning |
---|---|---|
1000 | Invalid authorization token | Failed to verify authorization |
4002 | Invalid clientId | Can't find clientId by the authorization |
4003 | Invalid energy data | energy is smaller than the current value |