curl --request POST \
--url https://api.home.datanumia.com/api/v2/person/synchronization \
--header 'Content-Type: application/json' \
--data '
{
"ts": "2017-07-21T17:32:28Z",
"person": {
"personCustomerId": "person-45634",
"personId": "<string>",
"content": {
"title": "Mme",
"firstName": "Jane",
"lastName": "Doe",
"address": {
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"zipCode": "92400",
"city": "Courbevoie",
"country": "France"
},
"mobile": "+33638854792",
"email": "api@datanumia.com"
}
},
"sites": [
{
"siteCustomerId": "site-45634",
"siteId": "<string>",
"content": {
"pointsOfDelivery": {
"elec": [
{
"elecPointOfDeliveryId": "<string>",
"meter": {
"id": "<string>",
"firstCommunicationDate": "2017-07-21"
}
}
],
"gas": [
{
"gasPointOfDeliveryId": "<string>",
"meter": {
"digitNumber": 123
}
}
]
},
"serviceOffers": [
{
"code": "<string>"
}
]
}
}
]
}
'import requests
url = "https://api.home.datanumia.com/api/v2/person/synchronization"
payload = {
"ts": "2017-07-21T17:32:28Z",
"person": {
"personCustomerId": "person-45634",
"personId": "<string>",
"content": {
"title": "Mme",
"firstName": "Jane",
"lastName": "Doe",
"address": {
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"zipCode": "92400",
"city": "Courbevoie",
"country": "France"
},
"mobile": "+33638854792",
"email": "api@datanumia.com"
}
},
"sites": [
{
"siteCustomerId": "site-45634",
"siteId": "<string>",
"content": {
"pointsOfDelivery": {
"elec": [
{
"elecPointOfDeliveryId": "<string>",
"meter": {
"id": "<string>",
"firstCommunicationDate": "2017-07-21"
}
}
],
"gas": [
{
"gasPointOfDeliveryId": "<string>",
"meter": { "digitNumber": 123 }
}
]
},
"serviceOffers": [{ "code": "<string>" }]
}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ts: '2017-07-21T17:32:28Z',
person: {
personCustomerId: 'person-45634',
personId: '<string>',
content: {
title: 'Mme',
firstName: 'Jane',
lastName: 'Doe',
address: {
streetNumberAndName: '4 bis place des vosges',
streetAdditionalInfo: 'BP 90137 44701',
locationAdditionalInfo: 'Batiment B',
zipCode: '92400',
city: 'Courbevoie',
country: 'France'
},
mobile: '+33638854792',
email: 'api@datanumia.com'
}
},
sites: [
{
siteCustomerId: 'site-45634',
siteId: '<string>',
content: {
pointsOfDelivery: {
elec: [
{
elecPointOfDeliveryId: '<string>',
meter: {id: '<string>', firstCommunicationDate: '2017-07-21'}
}
],
gas: [{gasPointOfDeliveryId: '<string>', meter: {digitNumber: 123}}]
},
serviceOffers: [{code: '<string>'}]
}
}
]
})
};
fetch('https://api.home.datanumia.com/api/v2/person/synchronization', 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/person/synchronization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ts' => '2017-07-21T17:32:28Z',
'person' => [
'personCustomerId' => 'person-45634',
'personId' => '<string>',
'content' => [
'title' => 'Mme',
'firstName' => 'Jane',
'lastName' => 'Doe',
'address' => [
'streetNumberAndName' => '4 bis place des vosges',
'streetAdditionalInfo' => 'BP 90137 44701',
'locationAdditionalInfo' => 'Batiment B',
'zipCode' => '92400',
'city' => 'Courbevoie',
'country' => 'France'
],
'mobile' => '+33638854792',
'email' => 'api@datanumia.com'
]
],
'sites' => [
[
'siteCustomerId' => 'site-45634',
'siteId' => '<string>',
'content' => [
'pointsOfDelivery' => [
'elec' => [
[
'elecPointOfDeliveryId' => '<string>',
'meter' => [
'id' => '<string>',
'firstCommunicationDate' => '2017-07-21'
]
]
],
'gas' => [
[
'gasPointOfDeliveryId' => '<string>',
'meter' => [
'digitNumber' => 123
]
]
]
],
'serviceOffers' => [
[
'code' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.home.datanumia.com/api/v2/person/synchronization"
payload := strings.NewReader("{\n \"ts\": \"2017-07-21T17:32:28Z\",\n \"person\": {\n \"personCustomerId\": \"person-45634\",\n \"personId\": \"<string>\",\n \"content\": {\n \"title\": \"Mme\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address\": {\n \"streetNumberAndName\": \"4 bis place des vosges\",\n \"streetAdditionalInfo\": \"BP 90137 44701\",\n \"locationAdditionalInfo\": \"Batiment B\",\n \"zipCode\": \"92400\",\n \"city\": \"Courbevoie\",\n \"country\": \"France\"\n },\n \"mobile\": \"+33638854792\",\n \"email\": \"api@datanumia.com\"\n }\n },\n \"sites\": [\n {\n \"siteCustomerId\": \"site-45634\",\n \"siteId\": \"<string>\",\n \"content\": {\n \"pointsOfDelivery\": {\n \"elec\": [\n {\n \"elecPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"id\": \"<string>\",\n \"firstCommunicationDate\": \"2017-07-21\"\n }\n }\n ],\n \"gas\": [\n {\n \"gasPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"digitNumber\": 123\n }\n }\n ]\n },\n \"serviceOffers\": [\n {\n \"code\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.home.datanumia.com/api/v2/person/synchronization")
.header("Content-Type", "application/json")
.body("{\n \"ts\": \"2017-07-21T17:32:28Z\",\n \"person\": {\n \"personCustomerId\": \"person-45634\",\n \"personId\": \"<string>\",\n \"content\": {\n \"title\": \"Mme\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address\": {\n \"streetNumberAndName\": \"4 bis place des vosges\",\n \"streetAdditionalInfo\": \"BP 90137 44701\",\n \"locationAdditionalInfo\": \"Batiment B\",\n \"zipCode\": \"92400\",\n \"city\": \"Courbevoie\",\n \"country\": \"France\"\n },\n \"mobile\": \"+33638854792\",\n \"email\": \"api@datanumia.com\"\n }\n },\n \"sites\": [\n {\n \"siteCustomerId\": \"site-45634\",\n \"siteId\": \"<string>\",\n \"content\": {\n \"pointsOfDelivery\": {\n \"elec\": [\n {\n \"elecPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"id\": \"<string>\",\n \"firstCommunicationDate\": \"2017-07-21\"\n }\n }\n ],\n \"gas\": [\n {\n \"gasPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"digitNumber\": 123\n }\n }\n ]\n },\n \"serviceOffers\": [\n {\n \"code\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/person/synchronization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ts\": \"2017-07-21T17:32:28Z\",\n \"person\": {\n \"personCustomerId\": \"person-45634\",\n \"personId\": \"<string>\",\n \"content\": {\n \"title\": \"Mme\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address\": {\n \"streetNumberAndName\": \"4 bis place des vosges\",\n \"streetAdditionalInfo\": \"BP 90137 44701\",\n \"locationAdditionalInfo\": \"Batiment B\",\n \"zipCode\": \"92400\",\n \"city\": \"Courbevoie\",\n \"country\": \"France\"\n },\n \"mobile\": \"+33638854792\",\n \"email\": \"api@datanumia.com\"\n }\n },\n \"sites\": [\n {\n \"siteCustomerId\": \"site-45634\",\n \"siteId\": \"<string>\",\n \"content\": {\n \"pointsOfDelivery\": {\n \"elec\": [\n {\n \"elecPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"id\": \"<string>\",\n \"firstCommunicationDate\": \"2017-07-21\"\n }\n }\n ],\n \"gas\": [\n {\n \"gasPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"digitNumber\": 123\n }\n }\n ]\n },\n \"serviceOffers\": [\n {\n \"code\": \"<string>\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ts": "2017-07-21T17:32:28Z",
"person": {
"personCustomerId": "person-45634",
"personId": "<string>",
"content": {
"title": "Mme",
"firstName": "Jane",
"lastName": "Doe",
"address": {
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"zipCode": "92400",
"city": "Courbevoie",
"country": "France"
},
"mobile": "+33638854792",
"email": "api@datanumia.com"
}
},
"sites": [
{
"siteCustomerId": "site-45634",
"siteId": "<string>",
"content": {
"address": {
"zipCode": "92400",
"country": "France",
"streetNumber": "4 bis",
"streetName": "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": "<string>"
}
]
}
}
]
}{
"type": "<string>",
"title": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"personCustomerId": "<string>",
"personId": "<string>",
"siteCustomerId": "<string>",
"siteId": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"personCustomerId": "<string>",
"personId": "<string>",
"siteCustomerId": "<string>",
"siteId": "<string>"
}
]
}Synchronize a person
With this endpoint you are able to manage the person and its site lifecycle:
Handle all the subscribtion use cases:
- Subscribe a new person and its sites to a service offer
- Subscribe a new site of an existing person to a service offer
- Subscribe a new service offer to an existing site of an existing person
Handle the information modification of the person or its sites use cases:
- Update person personal information
- Update sites informations
Handle all the termination use cases:
- Terminate a specific site’s service offer
- Terminate one of the person’s site, meaning terminating all the site’s service offers
- Terminate of all the person’s sites, meaning terminating all the service offers of the person’s sites
General principles
This synchronization API asks for a “picture” of the desired state of the person, its sites and service offers. Then we execute all the subscription, modification and termination operations to synchronize HOME state for this person with the one sent in the body.
At the first subscribtion of a new person or a new site, HOME identifiers are sent back in the response body. They are needed to indentify the person and its sites in our APIs.
Lifecycle example
Let’s start from an initial state and subscribe a new person with two sites to two service offers by calling the POST person/synchronization.
Any new person or site must be subscribed with custumer Ids.
{
"ts": "2024-03-09T17:32:28Z",
"person": {
"personCustomerId": "personCustomerId",
"content": {
"mobile": "+33123456789"
//person personnal informations
}
},
"sites": [
{
"siteCustomerId": "siteCustomerId_1",
"content": {
"address": {
//site specific adress information
},
"pointsOfDelivery": {
//elec and gas point of delivery information
},
"serviceOffers": [
{
"code": "OF001"
},
{
"code": "OF002"
}
]
}
},
{
"siteCustomerId": "siteCustomerId_2",
"content": {
"address": {
//site specific adress informaton
},
"pointsOfDelivery": {
//elec and gas point of delivery information
},
"serviceOffers": [
{
"code": "OF001"
},
{
"code": "OF002"
}
]
}
}
]
}
Response:
{
"ts": "2024-03-09T17:32:28Z",
"person": {
"personId""randomPersonId"
//...
},
"sites": [
{
"siteId": "randomSiteId_1"
//...
},
{
"siteId": "randomSiteId_2"
//...
}
]
}
After the first subscription, these identifiers will be required to use person and site services such as the POST person/synchronization and almost any other HOME API
Then, let’s terminate the person second site with the POST person/synchronization by removing it from the site list. This means we terminate all the site’s service offers.
{
"ts": "2024-03-09T17:32:28Z",
"person": {
"personId": "randomPersonId",
"content": {
"mobile": "+33123456789"
//person personnal informations
}
},
"sites": [
{
"siteId": "randomSiteId_1",
"content": {
"address": {
//site specific adress informaton
},
"pointsOfDelivery": {
//elec and gas point of delivery information
},
"serviceOffers": [
{
"code": "OF001"
},
{
"code": "OF002"
}
]
}
}
]
}
We can also terminate the second service offer of the first site with the POST person/synchronization by removing the service offer code from the service offer list.
{
"ts": "2024-03-09T17:32:28Z",
"person": {
"personId": "randomPersonId",
"content": {
"mobile": "+33123456789"
//person personnal informations
}
},
"sites": [
{
"siteId": "randomSiteId_1",
"content": {
"address": {
//site specific adress informaton
},
"pointsOfDelivery": {
//elec and gas point of delivery information
},
"serviceOffers": [
{
"code": "OF001"
}
]
}
}
]
}
Until now, we did each termination operation invividualy. But we could of done them in the same POST person/synchronization by removing the second site from the site list AND removing the second service offer from the first site in the same body, resulting to posting the last example.
Given this person state, let’s see how to subscribe a new site and modify the person mobile phone number which is, for now, set to +33123456789.
Be carfull, you still need to send all the person and site other informations. Any missing field will be considered as a modification request from your side.
{
"ts": "2024-03-09T17:32:28Z",
"person": {
"personId": "randomPersonId",
"content": {
"mobile": "+33000000000"
//person personnal informations
}
},
"sites": [
{
"siteId": "randomSiteId_1",
"content": {
"address": {
//site specific adress informaton
},
"pointsOfDelivery": {
//elec and gas point of delivery information
},
"serviceOffers": [
{
"code": "OF001"
}
]
}
},
{
"siteCustomerId": "SiteCustomerId_3",
"content": {
"address": {
//site specific adress informaton
},
"pointsOfDelivery": {
//elec and gas point of delivery information
},
"serviceOffers": [
{
"code": "OF001"
},
{
"code": "OF002"
},
]
}
}
]
}
Response
{
"ts": "2024-03-09T17:32:28Z",
"person": {
"personId""randomPersonId"
//...
},
"sites": [
{
"siteId": "randomSiteId_1",
//...
},
{
"siteId": "randomSiteId_3",
//...
}
]
}
If you wanted to delete the person mobile phone number, you could of removed it from the body.
In order to terminate the person with all its sites, you can use the POST person/synchronization by sending an empty site list which means the desired state of the person is a person with no site subscribed to any service offer.
{
"ts":"2024-03-09T17:32:28Z",
"person":{
"personId":"randomPersonId",
"content":{
"mobile":"+33000000000"
}
},
"sites":[]
}
Errors
| Error code | Description |
|---|---|
| FIELD_IS_INVALID | A field content do not match the regex specified in the documentation |
| FIELD_IS_MANDATORY | A required field is missing |
| INTERNAL_ERROR | Requires an investigation to restore the service and/or correct the anomaly on Datanumia’s side |
| INVALID_SERVICE_OFFER_CODE | One of a service offer code does not match the configured service offers |
| OFFER_DUPLICATED | The serviceOffers list contains the same offer code multiple times |
| OFFER_MANDATORY | The serviceOffers list is missing in the site object |
| OPERATION_ALREADY_IN_PROGRESS | Two requests on the same person or site are executed concurrently. Do not send two requests on the same person or site in the same archive |
| OPERATION_NOT_SUPPORTED | A modification, termination or subscription operation is not supported |
| SITE_DUPLICATED | A person’s site list contains the same site multiple times |
| SITE_MANDATORY | The list of sites is empty or missing for a person not yet subscribed |
curl --request POST \
--url https://api.home.datanumia.com/api/v2/person/synchronization \
--header 'Content-Type: application/json' \
--data '
{
"ts": "2017-07-21T17:32:28Z",
"person": {
"personCustomerId": "person-45634",
"personId": "<string>",
"content": {
"title": "Mme",
"firstName": "Jane",
"lastName": "Doe",
"address": {
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"zipCode": "92400",
"city": "Courbevoie",
"country": "France"
},
"mobile": "+33638854792",
"email": "api@datanumia.com"
}
},
"sites": [
{
"siteCustomerId": "site-45634",
"siteId": "<string>",
"content": {
"pointsOfDelivery": {
"elec": [
{
"elecPointOfDeliveryId": "<string>",
"meter": {
"id": "<string>",
"firstCommunicationDate": "2017-07-21"
}
}
],
"gas": [
{
"gasPointOfDeliveryId": "<string>",
"meter": {
"digitNumber": 123
}
}
]
},
"serviceOffers": [
{
"code": "<string>"
}
]
}
}
]
}
'import requests
url = "https://api.home.datanumia.com/api/v2/person/synchronization"
payload = {
"ts": "2017-07-21T17:32:28Z",
"person": {
"personCustomerId": "person-45634",
"personId": "<string>",
"content": {
"title": "Mme",
"firstName": "Jane",
"lastName": "Doe",
"address": {
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"zipCode": "92400",
"city": "Courbevoie",
"country": "France"
},
"mobile": "+33638854792",
"email": "api@datanumia.com"
}
},
"sites": [
{
"siteCustomerId": "site-45634",
"siteId": "<string>",
"content": {
"pointsOfDelivery": {
"elec": [
{
"elecPointOfDeliveryId": "<string>",
"meter": {
"id": "<string>",
"firstCommunicationDate": "2017-07-21"
}
}
],
"gas": [
{
"gasPointOfDeliveryId": "<string>",
"meter": { "digitNumber": 123 }
}
]
},
"serviceOffers": [{ "code": "<string>" }]
}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ts: '2017-07-21T17:32:28Z',
person: {
personCustomerId: 'person-45634',
personId: '<string>',
content: {
title: 'Mme',
firstName: 'Jane',
lastName: 'Doe',
address: {
streetNumberAndName: '4 bis place des vosges',
streetAdditionalInfo: 'BP 90137 44701',
locationAdditionalInfo: 'Batiment B',
zipCode: '92400',
city: 'Courbevoie',
country: 'France'
},
mobile: '+33638854792',
email: 'api@datanumia.com'
}
},
sites: [
{
siteCustomerId: 'site-45634',
siteId: '<string>',
content: {
pointsOfDelivery: {
elec: [
{
elecPointOfDeliveryId: '<string>',
meter: {id: '<string>', firstCommunicationDate: '2017-07-21'}
}
],
gas: [{gasPointOfDeliveryId: '<string>', meter: {digitNumber: 123}}]
},
serviceOffers: [{code: '<string>'}]
}
}
]
})
};
fetch('https://api.home.datanumia.com/api/v2/person/synchronization', 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/person/synchronization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ts' => '2017-07-21T17:32:28Z',
'person' => [
'personCustomerId' => 'person-45634',
'personId' => '<string>',
'content' => [
'title' => 'Mme',
'firstName' => 'Jane',
'lastName' => 'Doe',
'address' => [
'streetNumberAndName' => '4 bis place des vosges',
'streetAdditionalInfo' => 'BP 90137 44701',
'locationAdditionalInfo' => 'Batiment B',
'zipCode' => '92400',
'city' => 'Courbevoie',
'country' => 'France'
],
'mobile' => '+33638854792',
'email' => 'api@datanumia.com'
]
],
'sites' => [
[
'siteCustomerId' => 'site-45634',
'siteId' => '<string>',
'content' => [
'pointsOfDelivery' => [
'elec' => [
[
'elecPointOfDeliveryId' => '<string>',
'meter' => [
'id' => '<string>',
'firstCommunicationDate' => '2017-07-21'
]
]
],
'gas' => [
[
'gasPointOfDeliveryId' => '<string>',
'meter' => [
'digitNumber' => 123
]
]
]
],
'serviceOffers' => [
[
'code' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.home.datanumia.com/api/v2/person/synchronization"
payload := strings.NewReader("{\n \"ts\": \"2017-07-21T17:32:28Z\",\n \"person\": {\n \"personCustomerId\": \"person-45634\",\n \"personId\": \"<string>\",\n \"content\": {\n \"title\": \"Mme\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address\": {\n \"streetNumberAndName\": \"4 bis place des vosges\",\n \"streetAdditionalInfo\": \"BP 90137 44701\",\n \"locationAdditionalInfo\": \"Batiment B\",\n \"zipCode\": \"92400\",\n \"city\": \"Courbevoie\",\n \"country\": \"France\"\n },\n \"mobile\": \"+33638854792\",\n \"email\": \"api@datanumia.com\"\n }\n },\n \"sites\": [\n {\n \"siteCustomerId\": \"site-45634\",\n \"siteId\": \"<string>\",\n \"content\": {\n \"pointsOfDelivery\": {\n \"elec\": [\n {\n \"elecPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"id\": \"<string>\",\n \"firstCommunicationDate\": \"2017-07-21\"\n }\n }\n ],\n \"gas\": [\n {\n \"gasPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"digitNumber\": 123\n }\n }\n ]\n },\n \"serviceOffers\": [\n {\n \"code\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.home.datanumia.com/api/v2/person/synchronization")
.header("Content-Type", "application/json")
.body("{\n \"ts\": \"2017-07-21T17:32:28Z\",\n \"person\": {\n \"personCustomerId\": \"person-45634\",\n \"personId\": \"<string>\",\n \"content\": {\n \"title\": \"Mme\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address\": {\n \"streetNumberAndName\": \"4 bis place des vosges\",\n \"streetAdditionalInfo\": \"BP 90137 44701\",\n \"locationAdditionalInfo\": \"Batiment B\",\n \"zipCode\": \"92400\",\n \"city\": \"Courbevoie\",\n \"country\": \"France\"\n },\n \"mobile\": \"+33638854792\",\n \"email\": \"api@datanumia.com\"\n }\n },\n \"sites\": [\n {\n \"siteCustomerId\": \"site-45634\",\n \"siteId\": \"<string>\",\n \"content\": {\n \"pointsOfDelivery\": {\n \"elec\": [\n {\n \"elecPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"id\": \"<string>\",\n \"firstCommunicationDate\": \"2017-07-21\"\n }\n }\n ],\n \"gas\": [\n {\n \"gasPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"digitNumber\": 123\n }\n }\n ]\n },\n \"serviceOffers\": [\n {\n \"code\": \"<string>\"\n }\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/person/synchronization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ts\": \"2017-07-21T17:32:28Z\",\n \"person\": {\n \"personCustomerId\": \"person-45634\",\n \"personId\": \"<string>\",\n \"content\": {\n \"title\": \"Mme\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"address\": {\n \"streetNumberAndName\": \"4 bis place des vosges\",\n \"streetAdditionalInfo\": \"BP 90137 44701\",\n \"locationAdditionalInfo\": \"Batiment B\",\n \"zipCode\": \"92400\",\n \"city\": \"Courbevoie\",\n \"country\": \"France\"\n },\n \"mobile\": \"+33638854792\",\n \"email\": \"api@datanumia.com\"\n }\n },\n \"sites\": [\n {\n \"siteCustomerId\": \"site-45634\",\n \"siteId\": \"<string>\",\n \"content\": {\n \"pointsOfDelivery\": {\n \"elec\": [\n {\n \"elecPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"id\": \"<string>\",\n \"firstCommunicationDate\": \"2017-07-21\"\n }\n }\n ],\n \"gas\": [\n {\n \"gasPointOfDeliveryId\": \"<string>\",\n \"meter\": {\n \"digitNumber\": 123\n }\n }\n ]\n },\n \"serviceOffers\": [\n {\n \"code\": \"<string>\"\n }\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ts": "2017-07-21T17:32:28Z",
"person": {
"personCustomerId": "person-45634",
"personId": "<string>",
"content": {
"title": "Mme",
"firstName": "Jane",
"lastName": "Doe",
"address": {
"streetNumberAndName": "4 bis place des vosges",
"streetAdditionalInfo": "BP 90137 44701",
"locationAdditionalInfo": "Batiment B",
"zipCode": "92400",
"city": "Courbevoie",
"country": "France"
},
"mobile": "+33638854792",
"email": "api@datanumia.com"
}
},
"sites": [
{
"siteCustomerId": "site-45634",
"siteId": "<string>",
"content": {
"address": {
"zipCode": "92400",
"country": "France",
"streetNumber": "4 bis",
"streetName": "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": "<string>"
}
]
}
}
]
}{
"type": "<string>",
"title": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"personCustomerId": "<string>",
"personId": "<string>",
"siteCustomerId": "<string>",
"siteId": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"errors": [
{
"code": "<string>",
"detail": "<string>",
"personCustomerId": "<string>",
"personId": "<string>",
"siteCustomerId": "<string>",
"siteId": "<string>"
}
]
}Path Parameters
Body
Response
person updated