curl --request GET \
--url https://api.home.datanumia.com/api/v2/sites \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.home.datanumia.com/api/v2/sites"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.home.datanumia.com/api/v2/sites', 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/v2/sites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/v2/sites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/v2/sites")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/sites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_links": {
"first": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=0&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"prev": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=0&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"self": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=1&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"next": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=1&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"last": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=1&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
}
},
"page": {
"totalElements": 122,
"totalPages": 2,
"number": 1,
"size": 100
},
"_embedded": {
"sites": [
{
"ts": "2017-07-21T17:32:28Z",
"ids": {
"siteId": "siteId1",
"siteCustomerId": "site-45634"
},
"content": {
"address": {
"zipCode": "92400",
"country": "France",
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"city": "Courbevoie"
},
"pointsOfDelivery": {
"elec": [
{
"elecPointOfDeliveryId": "<string>",
"meter": {
"type": "ELECTRONIC_METER",
"id": "<string>",
"firstCommunicationDate": "2017-07-21"
}
}
],
"gas": [
{
"gasPointOfDeliveryId": "<string>",
"meter": {
"type": "MECHANICAL_METER",
"digitNumber": 123
}
}
]
},
"serviceOffers": [
{
"code": "OF060",
"statusHistory": [
{
"ts": "2021-07-22T00:00:00Z",
"status": "SUBSCRIPTION_IN_PROGRESS"
}
]
}
]
},
"_links": {
"self": {
"href": "https://<DATANUMIA_ROOT_URL>/sites/{site-id}"
}
}
}
]
}
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "INVALID_AUTHORIZATION_HEADER_VALUE",
"errorDescription": "The Authorization header is invalid"
}{
"errorCode": "ACCESS_DENIED",
"errorDescription": "The Authorization token does not have permission to the resource"
}This response has no body data.get a list of sites
Returns a list of sites corresponding to the search criterias including their offers statuses.
By default, only the ids of the objects are returned.
A complete snaphost of the object can be returned using the view parameter.
Results are paginated.
curl --request GET \
--url https://api.home.datanumia.com/api/v2/sites \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.home.datanumia.com/api/v2/sites"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.home.datanumia.com/api/v2/sites', 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/v2/sites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/v2/sites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/v2/sites")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/sites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_links": {
"first": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=0&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"prev": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=0&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"self": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=1&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"next": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=1&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
},
"last": {
"href": "https://<DATANUMIA_ROOT_URL>/sites?page=1&beginTs=2021-07-21T00:00:00Z&endTs=2021-07-28T00:00:00Z"
}
},
"page": {
"totalElements": 122,
"totalPages": 2,
"number": 1,
"size": 100
},
"_embedded": {
"sites": [
{
"ts": "2017-07-21T17:32:28Z",
"ids": {
"siteId": "siteId1",
"siteCustomerId": "site-45634"
},
"content": {
"address": {
"zipCode": "92400",
"country": "France",
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"city": "Courbevoie"
},
"pointsOfDelivery": {
"elec": [
{
"elecPointOfDeliveryId": "<string>",
"meter": {
"type": "ELECTRONIC_METER",
"id": "<string>",
"firstCommunicationDate": "2017-07-21"
}
}
],
"gas": [
{
"gasPointOfDeliveryId": "<string>",
"meter": {
"type": "MECHANICAL_METER",
"digitNumber": 123
}
}
]
},
"serviceOffers": [
{
"code": "OF060",
"statusHistory": [
{
"ts": "2021-07-22T00:00:00Z",
"status": "SUBSCRIPTION_IN_PROGRESS"
}
]
}
]
},
"_links": {
"self": {
"href": "https://<DATANUMIA_ROOT_URL>/sites/{site-id}"
}
}
}
]
}
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "INVALID_AUTHORIZATION_HEADER_VALUE",
"errorDescription": "The Authorization header is invalid"
}{
"errorCode": "ACCESS_DENIED",
"errorDescription": "The Authorization token does not have permission to the resource"
}This response has no body data.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Define on which element to apply the beginTs and endTs parameters.
Value can be SITE or SERVICE_OFFER.
the page to be fetched. Default value is 0
the page size to be fetched. Default value is 100. Max value is 100
x <= 100Define the start timestamp of the range to reduce the number of sites returned.
Objects modified within the range are returned.
This operation relies on the modification date of sites object.
The supported format is as defined by RFC 3339, section 5.6 restricted to : full-date'T'partial-time'Z'
Default is today at midnight -1 days. Period between beginTs and endTs is at most 30 days.
Define the end timestamp of the range to reduce the number of sites returned.
Objects modified within the range are returned.
This operation relies on the modification date of sites object.
The supported format is as defined by RFC 3339, section 5.6 restricted to : full-date'T'partial-time'Z'
Default is today at midnight. Period between beginTs and endTs is at most 30 days.
The service offers to use as a filter. A service offer code can optionaly be defined along with the desired status for the service offer.
Format: [SERVICE_OFFER_DEF[,SERVICE_OFFER_DEF]]
SERVICE_OFFER_DEF == <SERVICE_OFFER_CODE>[:STATUS_LIST]
STATUS_LIST == SERVICE_OFFER_STATUS[;SERVICE_OFFER_STATUS]
SERVICE_OFFER_STATUS == SUBSCRIPTION_IN_PROGRESS | SUBSCRIBED | TERMINATED
By default, the overview mode is delivered, only the ids of the objects are returned. A complete snaphost of the object can be returned using the details parameter.
overview, details the ids of the sites to fetch
the customer ids of the sites to fetch