Get challenges (depending on the provided site and filters)
curl --request GET \
--url https://api.home.datanumia.com/api/v1/sites/{site-id}/challengesimport requests
url = "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"units": {
"energyMeter": "KWH",
"cost": "EUR"
},
"challenges": [
{
"challengeId": "CHALLENGE_SPRINT_2023_10",
"challengeFamily": "MY_CHALLENGE_FAMILY",
"challengeType": "PEAK_DAY",
"beginDate": "2023-10-01",
"endDate": "2024-01-01",
"parentChallengeId": "CHALLENGE_MARATHON_2023_10",
"engagementStatus": "ENGAGED",
"engagementDate": "2023-10-10",
"disengagementDate": "2023-11-10",
"minEngagementDate": "2023-10-01",
"maxEngagementDate": "2023-12-01",
"engagementsNumber": 1200,
"maxEngagementsNumber": 1200,
"requiredContractExistenceInMonths": 12,
"status": "KO",
"reason": "REAL_NOT_RECEIVED",
"actualConsumption": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"estimatedConsumption": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"removedConsumption": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"removedConsumptionPercentage": 12,
"removalSuccessThreshold": 10.5,
"consumptionTarget": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"consumptionPeriod": {
"beginTs": "2023-05-01T00:00:00+02:00",
"endTs": "2023-05-06T00:00:00+02:00"
}
}
],
"limit": 5,
"orderBy": "BEGIN_DATE_ASC"
}{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}Challenge
Get challenges (depending on the provided site and filters)
This API returns :
- a filtered, ordered and sorted list of challenges
- the date of engagement, i.e. the date when the site engaged (if the site didn’t engage, the date is not returned)
- the number of sites participating in the challenge (the number of engaged sites)
- the actual consumption since the date of engagement - the forecasted consumption
GET
/
sites
/
{site-id}
/
challenges
Get challenges (depending on the provided site and filters)
curl --request GET \
--url https://api.home.datanumia.com/api/v1/sites/{site-id}/challengesimport requests
url = "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v1/sites/{site-id}/challenges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"units": {
"energyMeter": "KWH",
"cost": "EUR"
},
"challenges": [
{
"challengeId": "CHALLENGE_SPRINT_2023_10",
"challengeFamily": "MY_CHALLENGE_FAMILY",
"challengeType": "PEAK_DAY",
"beginDate": "2023-10-01",
"endDate": "2024-01-01",
"parentChallengeId": "CHALLENGE_MARATHON_2023_10",
"engagementStatus": "ENGAGED",
"engagementDate": "2023-10-10",
"disengagementDate": "2023-11-10",
"minEngagementDate": "2023-10-01",
"maxEngagementDate": "2023-12-01",
"engagementsNumber": 1200,
"maxEngagementsNumber": 1200,
"requiredContractExistenceInMonths": 12,
"status": "KO",
"reason": "REAL_NOT_RECEIVED",
"actualConsumption": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"estimatedConsumption": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"removedConsumption": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"removedConsumptionPercentage": 12,
"removalSuccessThreshold": 10.5,
"consumptionTarget": {
"energyMeter": {
"total": 10.38
},
"cost": {
"total": 20.23
}
},
"consumptionPeriod": {
"beginTs": "2023-05-01T00:00:00+02:00",
"endTs": "2023-05-06T00:00:00+02:00"
}
}
],
"limit": 5,
"orderBy": "BEGIN_DATE_ASC"
}{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}{
"type": {},
"status": 123,
"title": "<string>",
"detail": "<string>",
"instance": {},
"properties": {}
}Path Parameters
The site identifier
Query Parameters
The minimal begin date
The maximal begin date
The minimal end date
The maximal end date
The challenge family
The challenge type
Available options:
PEAK_DAY, REWARD_DAY, SHIFT_DAY, PERIOD, MARATHON, SPRINT, VARIATION_CONSUMPTION_DAY, REDUCE_CONSUMPTION_DAY, OVER_CONSUMPTION_DAY The limit of challenge to retrieve
Order and sort challenge by date
Available options:
BEGIN_DATE_ASC, BEGIN_DATE_DESC, END_DATE_ASC, END_DATE_DESC Response
Successful response
Units by type of consumption
Show child attributes
Show child attributes
The list of challenges
Show child attributes
Show child attributes
limit of challenges received
Example:
5
challenges ordered and sorted by field
Available options:
BEGIN_DATE_ASC, BEGIN_DATE_DESC, END_DATE_ASC, END_DATE_DESC Example:
"BEGIN_DATE_ASC"