Api session event editor netload generate loads: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
!Values | !Values | ||
|- | |- | ||
|0 | | 0 | ||
|REQUIRED | | REQUIRED | ||
|(Enumeration) | | (Enumeration) | ||
|[[Net Type]] | | [[Net Type]] | ||
|ELECTRICITY, GAS, HEAT, INTERNET or SEWER | | ELECTRICITY, GAS, HEAT, INTERNET or SEWER | ||
|- | |- | ||
|1 | | 1 | ||
|REQUIRED | | REQUIRED | ||
|(MultiPolygon with crs: EPSG:3857) | | (MultiPolygon with crs: EPSG:3857) | ||
|[[#Api Model MultiPolygon|MultiPolygon]] | | [[#Api Model MultiPolygon|MultiPolygon]] | ||
| | | | ||
|- | |- | ||
|2 | | 2 | ||
|REQUIRED | | REQUIRED | ||
|(Category or multiple values in array [a, b, c]) | | (Category or multiple values in array [a, b, c]) | ||
|[[Category]][] | | [[Category]][] | ||
| | | | ||
|- | |- | ||
|3 | | 3 | ||
|REQUIRED | | REQUIRED | ||
|(Integer number) | | (Integer number) | ||
|Integer | | Integer | ||
| | | | ||
|- | |- | ||
|4 | | 4 | ||
|REQUIRED | | REQUIRED | ||
|(Integer number) | | (Integer number) | ||
|Integer | | Integer | ||
| | | | ||
|- | |- | ||
|5 | | 5 | ||
|REQUIRED | | REQUIRED | ||
|(STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | | (STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | ||
|[[Stakeholder]]s | | [[Stakeholder]]s | ||
| | | | ||
|- | |- | ||
|6 | | 6 | ||
|REQUIRED | | REQUIRED | ||
|(STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | | (STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | ||
|[[Stakeholder]]s | | [[Stakeholder]]s | ||
| | | | ||
|- | |- | ||
|7 | | 7 | ||
|REQUIRED | | REQUIRED | ||
|(true, false) | | (true, false) | ||
|Boolean | | Boolean | ||
|true or false | | true or false | ||
|} | |} | ||
===Response Codes=== | ===Response Codes=== | ||
| Line 63: | Line 63: | ||
!Description | !Description | ||
|- | |- | ||
|204 | | 204 | ||
|No Content | | No Content | ||
|- | |- | ||
|300-600 | | 300-600 | ||
|Codes Overview | | Codes Overview | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Revision as of 11:40, 8 June 2026
API Endpoint: api/session/event/editornetload/generate_loads/
Description: Generate Loads
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (Enumeration) | Net Type | 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]) | Stakeholders | |
| 6 | REQUIRED | (STAKEHOLDER Integer ID or multiple values in array [1, 2, 3]) | Stakeholders | |
| 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, true ]
'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, true ]'
};
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));