Projects
Create a project
Creates a new project. Returns the created project ID. May attach an X-Message header with a non-blocking warning about the new entity.
Parameters:
-
project(body, required): The project entity to create. -
enableMeteonormDownload(query, optional): Whether to enable Meteonorm weather data download. Default: false.
POST
/
Project
Create a project
curl --request POST \
--url https://api.plantpredict.terabase.energy/Project \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"latitude": 41.6528052,
"longitude": -83.5378674,
"country": "United States",
"countryCode": "US",
"stateProvince": "Ohio",
"stateProvinceCode": "OH",
"locality": "Toledo",
"region": "North America",
"elevation": 178.5460357666016,
"standardOffsetFromUTC": -5,
"predictions": [],
"status": 0,
"name": "Sample Project",
"description": null
}
'import requests
url = "https://api.plantpredict.terabase.energy/Project"
payload = {
"latitude": 41.6528052,
"longitude": -83.5378674,
"country": "United States",
"countryCode": "US",
"stateProvince": "Ohio",
"stateProvinceCode": "OH",
"locality": "Toledo",
"region": "North America",
"elevation": 178.5460357666016,
"standardOffsetFromUTC": -5,
"predictions": [],
"status": 0,
"name": "Sample Project",
"description": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
latitude: 41.6528052,
longitude: -83.5378674,
country: 'United States',
countryCode: 'US',
stateProvince: 'Ohio',
stateProvinceCode: 'OH',
locality: 'Toledo',
region: 'North America',
elevation: 178.5460357666016,
standardOffsetFromUTC: -5,
predictions: [],
status: 0,
name: 'Sample Project',
description: null
})
};
fetch('https://api.plantpredict.terabase.energy/Project', 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/Project",
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([
'latitude' => 41.6528052,
'longitude' => -83.5378674,
'country' => 'United States',
'countryCode' => 'US',
'stateProvince' => 'Ohio',
'stateProvinceCode' => 'OH',
'locality' => 'Toledo',
'region' => 'North America',
'elevation' => 178.5460357666016,
'standardOffsetFromUTC' => -5,
'predictions' => [
],
'status' => 0,
'name' => 'Sample Project',
'description' => null
]),
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/Project"
payload := strings.NewReader("{\n \"latitude\": 41.6528052,\n \"longitude\": -83.5378674,\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"stateProvince\": \"Ohio\",\n \"stateProvinceCode\": \"OH\",\n \"locality\": \"Toledo\",\n \"region\": \"North America\",\n \"elevation\": 178.5460357666016,\n \"standardOffsetFromUTC\": -5,\n \"predictions\": [],\n \"status\": 0,\n \"name\": \"Sample Project\",\n \"description\": null\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.plantpredict.terabase.energy/Project")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"latitude\": 41.6528052,\n \"longitude\": -83.5378674,\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"stateProvince\": \"Ohio\",\n \"stateProvinceCode\": \"OH\",\n \"locality\": \"Toledo\",\n \"region\": \"North America\",\n \"elevation\": 178.5460357666016,\n \"standardOffsetFromUTC\": -5,\n \"predictions\": [],\n \"status\": 0,\n \"name\": \"Sample Project\",\n \"description\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"latitude\": 41.6528052,\n \"longitude\": -83.5378674,\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"stateProvince\": \"Ohio\",\n \"stateProvinceCode\": \"OH\",\n \"locality\": \"Toledo\",\n \"region\": \"North America\",\n \"elevation\": 178.5460357666016,\n \"standardOffsetFromUTC\": -5,\n \"predictions\": [],\n \"status\": 0,\n \"name\": \"Sample Project\",\n \"description\": null\n}"
response = http.request(request)
puts response.read_body{
"id": 76495
}{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}"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.
Query Parameters
Body
application/json
ProjectStatusEnum
Available options:
0, 1, 2 Response
Created project ID
⌘I
Create a project
curl --request POST \
--url https://api.plantpredict.terabase.energy/Project \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"latitude": 41.6528052,
"longitude": -83.5378674,
"country": "United States",
"countryCode": "US",
"stateProvince": "Ohio",
"stateProvinceCode": "OH",
"locality": "Toledo",
"region": "North America",
"elevation": 178.5460357666016,
"standardOffsetFromUTC": -5,
"predictions": [],
"status": 0,
"name": "Sample Project",
"description": null
}
'import requests
url = "https://api.plantpredict.terabase.energy/Project"
payload = {
"latitude": 41.6528052,
"longitude": -83.5378674,
"country": "United States",
"countryCode": "US",
"stateProvince": "Ohio",
"stateProvinceCode": "OH",
"locality": "Toledo",
"region": "North America",
"elevation": 178.5460357666016,
"standardOffsetFromUTC": -5,
"predictions": [],
"status": 0,
"name": "Sample Project",
"description": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
latitude: 41.6528052,
longitude: -83.5378674,
country: 'United States',
countryCode: 'US',
stateProvince: 'Ohio',
stateProvinceCode: 'OH',
locality: 'Toledo',
region: 'North America',
elevation: 178.5460357666016,
standardOffsetFromUTC: -5,
predictions: [],
status: 0,
name: 'Sample Project',
description: null
})
};
fetch('https://api.plantpredict.terabase.energy/Project', 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/Project",
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([
'latitude' => 41.6528052,
'longitude' => -83.5378674,
'country' => 'United States',
'countryCode' => 'US',
'stateProvince' => 'Ohio',
'stateProvinceCode' => 'OH',
'locality' => 'Toledo',
'region' => 'North America',
'elevation' => 178.5460357666016,
'standardOffsetFromUTC' => -5,
'predictions' => [
],
'status' => 0,
'name' => 'Sample Project',
'description' => null
]),
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/Project"
payload := strings.NewReader("{\n \"latitude\": 41.6528052,\n \"longitude\": -83.5378674,\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"stateProvince\": \"Ohio\",\n \"stateProvinceCode\": \"OH\",\n \"locality\": \"Toledo\",\n \"region\": \"North America\",\n \"elevation\": 178.5460357666016,\n \"standardOffsetFromUTC\": -5,\n \"predictions\": [],\n \"status\": 0,\n \"name\": \"Sample Project\",\n \"description\": null\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.plantpredict.terabase.energy/Project")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"latitude\": 41.6528052,\n \"longitude\": -83.5378674,\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"stateProvince\": \"Ohio\",\n \"stateProvinceCode\": \"OH\",\n \"locality\": \"Toledo\",\n \"region\": \"North America\",\n \"elevation\": 178.5460357666016,\n \"standardOffsetFromUTC\": -5,\n \"predictions\": [],\n \"status\": 0,\n \"name\": \"Sample Project\",\n \"description\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"latitude\": 41.6528052,\n \"longitude\": -83.5378674,\n \"country\": \"United States\",\n \"countryCode\": \"US\",\n \"stateProvince\": \"Ohio\",\n \"stateProvinceCode\": \"OH\",\n \"locality\": \"Toledo\",\n \"region\": \"North America\",\n \"elevation\": 178.5460357666016,\n \"standardOffsetFromUTC\": -5,\n \"predictions\": [],\n \"status\": 0,\n \"name\": \"Sample Project\",\n \"description\": null\n}"
response = http.request(request)
puts response.read_body{
"id": 76495
}{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}"An error has occurred."