Api session event editor netnode set location: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 43: Line 43:
|}
|}
===Example POST===
===Example POST===
Example POST: https://engine.tygron.com/api/session/event/editornetnode/set_location/?crs=3857&f=JSON&token=API_TOKEN
Curl Example POST:


with content:  
<syntaxhighlight lang="text" copy>curl 'https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
<pre>[ "GAS", 4, {
[ "ELECTRICITY", 1, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658675.6274282571, 6799358.204151612, -0.12 ]
  "coordinates" : [ 658758.9780925934, 6799348.022579272, -0.53 ]
}, 1.0 ]
}, 1.0 ]
</pre>
'
</syntaxhighlight>
Curl Example multi item POST:
 
<syntaxhighlight lang="text" copy>curl 'https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
"type" : "Point",
"coordinates" : [ 658790.9394667842, 6799449.764168823, -1.79 ]
}, 1.0 ]
'
</syntaxhighlight>
JavaScript Example POST:
 
<syntaxhighlight lang="text" copy>var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658758.9780925934, 6799348.022579272, -0.53 ]}, 1.0 ]'
};
fetch("https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));
</syntaxhighlight>
{{article end|seealso=*[[Api session event editor netnode]]
{{article end|seealso=*[[Api session event editor netnode]]
*[[Api session items netnodes]]
*[[Api session items netnodes]]

Revision as of 15:27, 8 April 2026

API Event to Set Location

Name Importance Type Description Values
0 REQUIRED (Enumeration) Network type ELECTRICITY, GAS, HEAT, INTERNET or SEWER
1 REQUIRED (NET_NODE Integer ID) Net Node ID
2 REQUIRED (Point 3D with crs: EPSG:3857) Location Point
3 OPTIONAL (Floating point number) Node merge distance (optional, default: 1.0m)

Response Codes

Response Code: Description
204 No Content
300-600 Codes Overview

Example POST

Curl Example POST:

curl 'https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
 "type" : "Point",
 "coordinates" : [ 658758.9780925934, 6799348.022579272, -0.53 ]
}, 1.0 ]
'

Curl Example multi item POST:

curl 'https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
 "type" : "Point",
 "coordinates" : [ 658790.9394667842, 6799449.764168823, -1.79 ]
}, 1.0 ]
'

JavaScript Example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658758.9780925934, 6799348.022579272, -0.53 ]}, 1.0 ]'
};
fetch("https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));