curl --request PATCH \
--url https://external.nectarclimate.com/v2.2/company/{company_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"externalId": "<string>",
"name": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": true,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"users": [
"jsmith@example.com"
]
}
'import requests
url = "https://external.nectarclimate.com/v2.2/company/{company_id}"
payload = {
"externalId": "<string>",
"name": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": True,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": True,
"isBasicIdentifierMappingEnabled": True,
"isLowAccuracyModeEnabled": True,
"users": ["jsmith@example.com"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalId: '<string>',
name: '<string>',
dataCollectionStartDate: '2023-12-25',
isImpliedMeteringEnabled: true,
impliedMeteringFraction: '<string>',
isDemandEnabled: true,
isBasicIdentifierMappingEnabled: true,
isLowAccuracyModeEnabled: true,
users: ['jsmith@example.com']
})
};
fetch('https://external.nectarclimate.com/v2.2/company/{company_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://external.nectarclimate.com/v2.2/company/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'externalId' => '<string>',
'name' => '<string>',
'dataCollectionStartDate' => '2023-12-25',
'isImpliedMeteringEnabled' => true,
'impliedMeteringFraction' => '<string>',
'isDemandEnabled' => true,
'isBasicIdentifierMappingEnabled' => true,
'isLowAccuracyModeEnabled' => true,
'users' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://external.nectarclimate.com/v2.2/company/{company_id}"
payload := strings.NewReader("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": true,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://external.nectarclimate.com/v2.2/company/{company_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": true,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/company/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": true,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isImpliedMeteringEnabled": true,
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"sites": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"dataCollectionStopDate": "2023-12-25",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"occupancyApplicationMode": "DISABLED",
"dummySiteReason": "<string>"
}
],
"users": [
"<string>"
],
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"impliedMeteringFraction": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}Update Company
Update the details of a specific company. You can also update the list of users using the users field. If users is provided, it replaces the current list of users. If users is not provided, the user list remains unchanged. You cannot remove yourself from the company.
Note: Users invited through the API must already have a Nectar account. If you provide email addresses of users who don’t exist in the system, the request will fail with a 400 error.
curl --request PATCH \
--url https://external.nectarclimate.com/v2.2/company/{company_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"externalId": "<string>",
"name": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": true,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"users": [
"jsmith@example.com"
]
}
'import requests
url = "https://external.nectarclimate.com/v2.2/company/{company_id}"
payload = {
"externalId": "<string>",
"name": "<string>",
"dataCollectionStartDate": "2023-12-25",
"isImpliedMeteringEnabled": True,
"impliedMeteringFraction": "<string>",
"isDemandEnabled": True,
"isBasicIdentifierMappingEnabled": True,
"isLowAccuracyModeEnabled": True,
"users": ["jsmith@example.com"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalId: '<string>',
name: '<string>',
dataCollectionStartDate: '2023-12-25',
isImpliedMeteringEnabled: true,
impliedMeteringFraction: '<string>',
isDemandEnabled: true,
isBasicIdentifierMappingEnabled: true,
isLowAccuracyModeEnabled: true,
users: ['jsmith@example.com']
})
};
fetch('https://external.nectarclimate.com/v2.2/company/{company_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://external.nectarclimate.com/v2.2/company/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'externalId' => '<string>',
'name' => '<string>',
'dataCollectionStartDate' => '2023-12-25',
'isImpliedMeteringEnabled' => true,
'impliedMeteringFraction' => '<string>',
'isDemandEnabled' => true,
'isBasicIdentifierMappingEnabled' => true,
'isLowAccuracyModeEnabled' => true,
'users' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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://external.nectarclimate.com/v2.2/company/{company_id}"
payload := strings.NewReader("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": true,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://external.nectarclimate.com/v2.2/company/{company_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": true,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.nectarclimate.com/v2.2/company/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"dataCollectionStartDate\": \"2023-12-25\",\n \"isImpliedMeteringEnabled\": true,\n \"impliedMeteringFraction\": \"<string>\",\n \"isDemandEnabled\": true,\n \"isBasicIdentifierMappingEnabled\": true,\n \"isLowAccuracyModeEnabled\": true,\n \"users\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"isImpliedMeteringEnabled": true,
"isDemandEnabled": true,
"isBasicIdentifierMappingEnabled": true,
"isLowAccuracyModeEnabled": true,
"sites": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"dataCollectionStopDate": "2023-12-25",
"externalId": "<string>",
"address": "<string>",
"path": [
"<string>"
],
"occupancyPercent": "<string>",
"occupancyApplicationMode": "DISABLED",
"dummySiteReason": "<string>"
}
],
"users": [
"<string>"
],
"externalId": "<string>",
"dataCollectionStartDate": "2023-12-25",
"impliedMeteringFraction": "<string>"
}{
"detail": "<string>",
"error": "<string>"
}Body
Serializer for updating an existing Company object.
Fraction used to estimate sewer usage from water usage for implied metering. If a sewage charge is found in the data without water usage, this fraction is used to estimate the waste water usage that corresponds to the sewage charge. Defaults to 1.0.
^-?\d{0,1}(?:\.\d{0,2})?$Response
Serializer for externally available fields of a Company object including related sites.
Fraction used to estimate sewer usage from water usage for implied metering. If a sewage charge is found in the data without water usage, this fraction is used to estimate the waste water usage that corresponds to the sewage charge. Defaults to 1.0.
^-?\d{0,1}(?:\.\d{0,2})?$