Weather
Update weather hourly detail records
Used to update details for an existing weather file. Note: This will completely overwrite the each timestamp with the provided values. If you omit data from the JSON it will not keep the previous values.
PUT
/
Weather
/
{weatherId}
/
Detail
Update weather hourly detail records
curl --request PUT \
--url https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"id": 123,
"weatherId": 123,
"index": 123,
"timeStamp": "<string>",
"globalHorizontalIrradiance": 123,
"diffuseHorizontalIrradiance": 123,
"directNormalIrradiance": 123,
"planeOfArrayIrradiance": 123,
"backsidePlaneOfArrayIrradiance": 123,
"temperature": 123,
"windspeed": 123,
"windDirection": 123,
"relativeHumidity": 123,
"dewpoint": 123,
"pressure": 123,
"precipitableWater": 123,
"rainfall": 123,
"albedoData": 123
}
]
'import requests
url = "https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail"
payload = [
{
"id": 123,
"weatherId": 123,
"index": 123,
"timeStamp": "<string>",
"globalHorizontalIrradiance": 123,
"diffuseHorizontalIrradiance": 123,
"directNormalIrradiance": 123,
"planeOfArrayIrradiance": 123,
"backsidePlaneOfArrayIrradiance": 123,
"temperature": 123,
"windspeed": 123,
"windDirection": 123,
"relativeHumidity": 123,
"dewpoint": 123,
"pressure": 123,
"precipitableWater": 123,
"rainfall": 123,
"albedoData": 123
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
id: 123,
weatherId: 123,
index: 123,
timeStamp: '<string>',
globalHorizontalIrradiance: 123,
diffuseHorizontalIrradiance: 123,
directNormalIrradiance: 123,
planeOfArrayIrradiance: 123,
backsidePlaneOfArrayIrradiance: 123,
temperature: 123,
windspeed: 123,
windDirection: 123,
relativeHumidity: 123,
dewpoint: 123,
pressure: 123,
precipitableWater: 123,
rainfall: 123,
albedoData: 123
}
])
};
fetch('https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail', 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.plantpredict.terabase.energy/Weather/{weatherId}/Detail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'id' => 123,
'weatherId' => 123,
'index' => 123,
'timeStamp' => '<string>',
'globalHorizontalIrradiance' => 123,
'diffuseHorizontalIrradiance' => 123,
'directNormalIrradiance' => 123,
'planeOfArrayIrradiance' => 123,
'backsidePlaneOfArrayIrradiance' => 123,
'temperature' => 123,
'windspeed' => 123,
'windDirection' => 123,
'relativeHumidity' => 123,
'dewpoint' => 123,
'pressure' => 123,
'precipitableWater' => 123,
'rainfall' => 123,
'albedoData' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.plantpredict.terabase.energy/Weather/{weatherId}/Detail"
payload := strings.NewReader("[\n {\n \"id\": 123,\n \"weatherId\": 123,\n \"index\": 123,\n \"timeStamp\": \"<string>\",\n \"globalHorizontalIrradiance\": 123,\n \"diffuseHorizontalIrradiance\": 123,\n \"directNormalIrradiance\": 123,\n \"planeOfArrayIrradiance\": 123,\n \"backsidePlaneOfArrayIrradiance\": 123,\n \"temperature\": 123,\n \"windspeed\": 123,\n \"windDirection\": 123,\n \"relativeHumidity\": 123,\n \"dewpoint\": 123,\n \"pressure\": 123,\n \"precipitableWater\": 123,\n \"rainfall\": 123,\n \"albedoData\": 123\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"id\": 123,\n \"weatherId\": 123,\n \"index\": 123,\n \"timeStamp\": \"<string>\",\n \"globalHorizontalIrradiance\": 123,\n \"diffuseHorizontalIrradiance\": 123,\n \"directNormalIrradiance\": 123,\n \"planeOfArrayIrradiance\": 123,\n \"backsidePlaneOfArrayIrradiance\": 123,\n \"temperature\": 123,\n \"windspeed\": 123,\n \"windDirection\": 123,\n \"relativeHumidity\": 123,\n \"dewpoint\": 123,\n \"pressure\": 123,\n \"precipitableWater\": 123,\n \"rainfall\": 123,\n \"albedoData\": 123\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"id\": 123,\n \"weatherId\": 123,\n \"index\": 123,\n \"timeStamp\": \"<string>\",\n \"globalHorizontalIrradiance\": 123,\n \"diffuseHorizontalIrradiance\": 123,\n \"directNormalIrradiance\": 123,\n \"planeOfArrayIrradiance\": 123,\n \"backsidePlaneOfArrayIrradiance\": 123,\n \"temperature\": 123,\n \"windspeed\": 123,\n \"windDirection\": 123,\n \"relativeHumidity\": 123,\n \"dewpoint\": 123,\n \"pressure\": 123,\n \"precipitableWater\": 123,\n \"rainfall\": 123,\n \"albedoData\": 123\n }\n]"
response = http.request(request)
puts response.read_body{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}"Project not found.""An error has occurred."Authorizations
Pass Authorization: Bearer <token> on every request. See the Authentication section of the API description for how to fetch a token.
Path Parameters
Body
application/json
ISO-8601 datetime as returned by the PlantPredict API. May or may not include a timezone offset; treat as server-local when no offset is present.
Response
Updated
⌘I
Update weather hourly detail records
curl --request PUT \
--url https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"id": 123,
"weatherId": 123,
"index": 123,
"timeStamp": "<string>",
"globalHorizontalIrradiance": 123,
"diffuseHorizontalIrradiance": 123,
"directNormalIrradiance": 123,
"planeOfArrayIrradiance": 123,
"backsidePlaneOfArrayIrradiance": 123,
"temperature": 123,
"windspeed": 123,
"windDirection": 123,
"relativeHumidity": 123,
"dewpoint": 123,
"pressure": 123,
"precipitableWater": 123,
"rainfall": 123,
"albedoData": 123
}
]
'import requests
url = "https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail"
payload = [
{
"id": 123,
"weatherId": 123,
"index": 123,
"timeStamp": "<string>",
"globalHorizontalIrradiance": 123,
"diffuseHorizontalIrradiance": 123,
"directNormalIrradiance": 123,
"planeOfArrayIrradiance": 123,
"backsidePlaneOfArrayIrradiance": 123,
"temperature": 123,
"windspeed": 123,
"windDirection": 123,
"relativeHumidity": 123,
"dewpoint": 123,
"pressure": 123,
"precipitableWater": 123,
"rainfall": 123,
"albedoData": 123
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
id: 123,
weatherId: 123,
index: 123,
timeStamp: '<string>',
globalHorizontalIrradiance: 123,
diffuseHorizontalIrradiance: 123,
directNormalIrradiance: 123,
planeOfArrayIrradiance: 123,
backsidePlaneOfArrayIrradiance: 123,
temperature: 123,
windspeed: 123,
windDirection: 123,
relativeHumidity: 123,
dewpoint: 123,
pressure: 123,
precipitableWater: 123,
rainfall: 123,
albedoData: 123
}
])
};
fetch('https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail', 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.plantpredict.terabase.energy/Weather/{weatherId}/Detail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'id' => 123,
'weatherId' => 123,
'index' => 123,
'timeStamp' => '<string>',
'globalHorizontalIrradiance' => 123,
'diffuseHorizontalIrradiance' => 123,
'directNormalIrradiance' => 123,
'planeOfArrayIrradiance' => 123,
'backsidePlaneOfArrayIrradiance' => 123,
'temperature' => 123,
'windspeed' => 123,
'windDirection' => 123,
'relativeHumidity' => 123,
'dewpoint' => 123,
'pressure' => 123,
'precipitableWater' => 123,
'rainfall' => 123,
'albedoData' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.plantpredict.terabase.energy/Weather/{weatherId}/Detail"
payload := strings.NewReader("[\n {\n \"id\": 123,\n \"weatherId\": 123,\n \"index\": 123,\n \"timeStamp\": \"<string>\",\n \"globalHorizontalIrradiance\": 123,\n \"diffuseHorizontalIrradiance\": 123,\n \"directNormalIrradiance\": 123,\n \"planeOfArrayIrradiance\": 123,\n \"backsidePlaneOfArrayIrradiance\": 123,\n \"temperature\": 123,\n \"windspeed\": 123,\n \"windDirection\": 123,\n \"relativeHumidity\": 123,\n \"dewpoint\": 123,\n \"pressure\": 123,\n \"precipitableWater\": 123,\n \"rainfall\": 123,\n \"albedoData\": 123\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"id\": 123,\n \"weatherId\": 123,\n \"index\": 123,\n \"timeStamp\": \"<string>\",\n \"globalHorizontalIrradiance\": 123,\n \"diffuseHorizontalIrradiance\": 123,\n \"directNormalIrradiance\": 123,\n \"planeOfArrayIrradiance\": 123,\n \"backsidePlaneOfArrayIrradiance\": 123,\n \"temperature\": 123,\n \"windspeed\": 123,\n \"windDirection\": 123,\n \"relativeHumidity\": 123,\n \"dewpoint\": 123,\n \"pressure\": 123,\n \"precipitableWater\": 123,\n \"rainfall\": 123,\n \"albedoData\": 123\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Weather/{weatherId}/Detail")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"id\": 123,\n \"weatherId\": 123,\n \"index\": 123,\n \"timeStamp\": \"<string>\",\n \"globalHorizontalIrradiance\": 123,\n \"diffuseHorizontalIrradiance\": 123,\n \"directNormalIrradiance\": 123,\n \"planeOfArrayIrradiance\": 123,\n \"backsidePlaneOfArrayIrradiance\": 123,\n \"temperature\": 123,\n \"windspeed\": 123,\n \"windDirection\": 123,\n \"relativeHumidity\": 123,\n \"dewpoint\": 123,\n \"pressure\": 123,\n \"precipitableWater\": 123,\n \"rainfall\": 123,\n \"albedoData\": 123\n }\n]"
response = http.request(request)
puts response.read_body{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}"Project not found.""An error has occurred."