Api session event editor netload generate loads: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
API | API Endpoint to Generate Loads | ||
{|class=wikitable | {|class=wikitable | ||
!Name | !Name | ||
| Line 69: | Line 69: | ||
Curl Example POST: | Curl Example POST: | ||
<syntaxhighlight lang="text" copy>curl 'https:// | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetload/generate_loads/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ "ELECTRICITY", { | [ "ELECTRICITY", { | ||
"type" : "MultiPolygon", | "type" : "MultiPolygon", | ||
| Line 78: | Line 78: | ||
Curl Example multi item POST: | Curl Example multi item POST: | ||
<syntaxhighlight lang="text" copy>curl 'https:// | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetload/generate_loads/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ "ELECTRICITY", { | [ "ELECTRICITY", { | ||
"type" : "MultiPolygon", | "type" : "MultiPolygon", | ||
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ] | "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ] | ||
}, [ "SOCIAL", "NORMAL", "LUXE" ], 1, 1, [ 1, 2, 3 ], [ 1, 2, 3 ], | }, [ "SOCIAL", "NORMAL", "LUXE" ], 1, 1, [ 1, 2, 3 ], [ 1, 2, 3 ], true ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 92: | Line 92: | ||
body: '[ "ELECTRICITY", { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, "SOCIAL", 1, 1, 1, 1, false ]' | body: '[ "ELECTRICITY", { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, "SOCIAL", 1, 1, 1, 1, false ]' | ||
}; | }; | ||
fetch("https:// | fetch("https://engine.tygron.com/api/session/event/editornetload/generate_loads/?crs=3857", options) | ||
.then(response => response.text()) | .then(response => response.text()) | ||
.then(result => console.log(result)) | .then(result => console.log(result)) | ||
Revision as of 09:08, 10 April 2026
API Endpoint to Generate Loads
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (Enumeration) | NetType | ELECTRICITY, GAS, HEAT, INTERNET or SEWER |
| 1 | REQUIRED | (MultiPolygon with crs: EPSG:3857) | MultiPolygon | |
| 2 | REQUIRED | (Category or multiple values in array [a, b, c]) | Category[] | |
| 3 | REQUIRED | (Integer number) | Integer | |
| 4 | REQUIRED | (Integer number) | Integer | |
| 5 | REQUIRED | (STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | Stakeholder | |
| 6 | REQUIRED | (STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | Stakeholder | |
| 7 | REQUIRED | (true, false) | Boolean | true or false |
Response Codes
| Response Code: | Description |
|---|---|
| 204 | No Content |
| 300-600 | Codes Overview |
Example POST
Curl Example POST:
curl 'https://engine.tygron.com/api/session/event/editornetload/generate_loads/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
}, "SOCIAL", 1, 1, 1, 1, false ]
'Curl Example multi item POST:
curl 'https://engine.tygron.com/api/session/event/editornetload/generate_loads/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
}, [ "SOCIAL", "NORMAL", "LUXE" ], 1, 1, [ 1, 2, 3 ], [ 1, 2, 3 ], true ]
'JavaScript Example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ "ELECTRICITY", { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, "SOCIAL", 1, 1, 1, 1, false ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetload/generate_loads/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));