Api session event editor map set height sector

From Tygron Support wiki
Jump to navigation Jump to search

API Endpoint: editormap/set_height_sector.

Description: Update Heightmap Sector Data

Name Importance Type Description Values
0 REQUIRED (HEIGHT Integer ID) Height Sector ID
1 REQUIRED (Integer number or multiple values in array [1, 2, 3]) Header: sector widthPoints, columns, rows, baseX, baseY
2 REQUIRED (Floating point number or multiple values in array [1.0, 2.0, 3.0]) Matrix Data Array

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/editormap/set_height_sector/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, 1, 1.0 ]'

Curl example multi item POST:

curl 'https://engine.tygron.com/api/session/event/editormap/set_height_sector/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, [ 1, 2, 3 ], [ 1.0, 2.0, 3.0 ] ]'

JavaScript example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ 1, 1, 1.0 ]'
};
fetch("https://engine.tygron.com/api/session/event/editormap/set_height_sector/", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));