Api session event editor building add geometry: Difference between revisions
Jump to navigation
Jump to search
Created page with "API Event to Add a custom building geometry {|class=wikitable !Name !Importance !Type !Description !Values |- |0 |REQUIRED |(BUILDING Integer ID or multiple values in array [1, 2, 3]) |Building ID | |- |1 |REQUIRED |(CUSTOM_GEOMETRIE Integer ID or multiple values in array [1, 2, 3]) |Custom Geometry ID | |- |2 |REQUIRED |(boolean or multiple values in array [a, b, c]) |Primary building for geometry | |- |3 |OPTIONAL |(SOURCE Integer ID) |Source (optional) | |} ==..." |
No edit summary |
||
| (17 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
API | API Endpoint: api/session/event/editorbuilding/add_geometry/ | ||
Description: Add a custom [[Building]] geometry | |||
{|class=wikitable | {|class=wikitable | ||
!Name | !Name | ||
| Line 16: | Line 19: | ||
|REQUIRED | |REQUIRED | ||
|(CUSTOM_GEOMETRIE Integer ID or multiple values in array [1, 2, 3]) | |(CUSTOM_GEOMETRIE Integer ID or multiple values in array [1, 2, 3]) | ||
|Custom Geometry ID | |[[Custom Geometry]] ID | ||
| | | | ||
|- | |- | ||
| Line 22: | Line 25: | ||
|REQUIRED | |REQUIRED | ||
|(boolean or multiple values in array [a, b, c]) | |(boolean or multiple values in array [a, b, c]) | ||
|Primary | |Primary [[Building]] for geometry | ||
| | | | ||
|- | |- | ||
| Line 43: | Line 46: | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Curl example POST: | |||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editorbuilding/add_geometry/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, 1, true ]' | |||
</syntaxhighlight> | |||
Curl example multi item POST: | |||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editorbuilding/add_geometry/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ [ 1, 2, 3 ], [ 1, 2, 3 ], [ true, false, true ] ]' | |||
</syntaxhighlight> | |||
JavaScript example POST: | |||
<syntaxhighlight lang="text" copy>var options = { | |||
< | method: "POST", | ||
</ | headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | ||
{{article end|seealso=*[[ | body: '[ 1, 1, true ]' | ||
}; | |||
fetch("https://engine.tygron.com/api/session/event/editorbuilding/add_geometry/", options) | |||
.then(response => response.text()) | |||
.then(result => console.log(result)) | |||
.catch(error => console.log('error', error)); | |||
</syntaxhighlight> | |||
{{article end|seealso=*[[Api session event editor building]] | |||
*[[Api session items buildings]] | |||
}} | |||
[[Category:API]] | [[Category:API]] | ||
Latest revision as of 11:26, 19 May 2026
API Endpoint: api/session/event/editorbuilding/add_geometry/
Description: Add a custom Building geometry
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (BUILDING Integer ID or multiple values in array [1, 2, 3]) | Building ID | |
| 1 | REQUIRED | (CUSTOM_GEOMETRIE Integer ID or multiple values in array [1, 2, 3]) | Custom Geometry ID | |
| 2 | REQUIRED | (boolean or multiple values in array [a, b, c]) | Primary Building for geometry | |
| 3 | OPTIONAL | (SOURCE Integer ID) | Source (optional) |
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/editorbuilding/add_geometry/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, 1, true ]'Curl example multi item POST:
curl 'https://engine.tygron.com/api/session/event/editorbuilding/add_geometry/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ [ 1, 2, 3 ], [ 1, 2, 3 ], [ true, false, true ] ]'JavaScript example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, 1, true ]'
};
fetch("https://engine.tygron.com/api/session/event/editorbuilding/add_geometry/", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));