get a site content
curl --request GET \
--url https://api.home.datanumia.com/api/v2/sites/{site-id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.home.datanumia.com/api/v2/sites/{site-id}"
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/{site-id}', 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/{site-id}",
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/{site-id}"
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/{site-id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/sites/{site-id}")
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{
"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"
}{
"errorCode": "SITE_NOT_FOUND",
"errorDescription": "The site xxxx does not exist"
}This response has no body data.sites
get a site content
This API operation retrieve an existing site.
GET
/
sites
/
{site-id}
get a site content
curl --request GET \
--url https://api.home.datanumia.com/api/v2/sites/{site-id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.home.datanumia.com/api/v2/sites/{site-id}"
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/{site-id}', 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/{site-id}",
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/{site-id}"
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/{site-id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/sites/{site-id}")
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{
"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"
}{
"errorCode": "SITE_NOT_FOUND",
"errorDescription": "The site xxxx does not exist"
}This response has no body data.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
id of the site
Query Parameters
Available options:
ASC, DESC Response
get site detail in success
description: | The last modification date of the object as defined by RFC 3339, section 5.6 using the following format: full-date'T'partial-time'Z'
Example:
"2017-07-21T17:32:28Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes