Api session event editor netload generate loads and paths
Jump to navigation
Jump to search
API Endpoint: editornetload/generate_loads_and_paths.
Description: Generate Loads And Paths
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (NET_FUNCTION Integer ID) | Net Function | |
| 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 |
| 8 | REQUIRED | (Floating point number) | Double | |
| 9 | REQUIRED | (Floating point number) | Double |
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_and_paths/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
"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, 52, 25 ]
'Curl example multi item POST:
curl 'https://engine.tygron.com/api/session/event/editornetload/generate_loads_and_paths/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
"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 ], false, 21, 9 ]
'JavaScript example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, { "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, 52, 25 ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetload/generate_loads_and_paths/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));