Api event share set viewer input: Difference between revisions
Jump to navigation
Jump to search
Created page with "API Endpoint: api/event/share/set_viewer_input/ Description: Set viewer content array for given path. {|class=wikitable !Index !Importance !Type !Description !Values |- | 0 | REQUIRED | (String or multiple values in array ["a", "b", "c"]) | Path (note: viewers end with a slash e.g. "mydir/viewer/") | |- | 1 | REQUIRED | (String or multiple values in array ["a", "b", "c"] or matrix [["a", "b"], ["c", "d"], ["e", "f"]]) | Matrix of viewer input shareables (e.g. "mydir..." |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 35: | Line 35: | ||
===Example POST=== | ===Example POST=== | ||
Curl example POST | Curl example POST | ||
<syntaxhighlight lang="text" copy>curl 'https://devshare.tygron.com/api/event/share/set_viewer_input/' -H 'Content-Type: application/json' -H 'Authorization: Basic <credentials> | <syntaxhighlight lang="text" copy>curl 'https://devshare.tygron.com/api/event/share/set_viewer_input/' -H 'Content-Type: application/json' -H 'Authorization: Basic <credentials>' -d '[ "Path 1", [ "A1", "B1" ] ]' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Curl example multi item POST | Curl example multi item POST | ||
<syntaxhighlight lang="text" copy>curl 'https://devshare.tygron.com/api/event/share/set_viewer_input/' -H 'Content-Type: application/json' -H 'Authorization: Basic <credentials> | <syntaxhighlight lang="text" copy>curl 'https://devshare.tygron.com/api/event/share/set_viewer_input/' -H 'Content-Type: application/json' -H 'Authorization: Basic <credentials>' -d '[ [ "Path 1", "Path 2", "Path 3" ], [ [ "A1", "B1" ], [ "A2", "B2" ], [ "A3", "B3" ] ] ]' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
JavaScript example POST | JavaScript example POST | ||
<syntaxhighlight lang="text" copy>var options = { | <syntaxhighlight lang="text" copy>var options = { | ||
method: "POST", | method: "POST", | ||
headers: { "Content-Type": "application/json", "Authorization": "Basic <credentials> | headers: { "Content-Type": "application/json", "Authorization": "Basic <credentials>" }, | ||
body: '[ "Path 1", [ "A1", "B1" ] ]' | body: '[ "Path 1", [ "A1", "B1" ] ]' | ||
}; | }; | ||
Latest revision as of 15:18, 20 November 2026
API Endpoint: api/event/share/set_viewer_input/
Description: Set viewer content array for given path.
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (String or multiple values in array ["a", "b", "c"]) | Path (note: viewers end with a slash e.g. "mydir/viewer/") | |
| 1 | REQUIRED | (String or multiple values in array ["a", "b", "c"] or matrix [["a", "b"], ["c", "d"], ["e", "f"]]) | Matrix of viewer input shareables (e.g. [["mydir/features.geojson", "mydir/Overlay-0.tiff"]], note: adding a tiff ending with "-0.tiff" will automatically add additional Timeframes like "-1.tiff") |
Response Codes
| Response Code: | Description |
|---|---|
| 200 | Boolean (Content was updated) |
| 300-600 | Codes Overview |
Example POST
Curl example POST
curl 'https://devshare.tygron.com/api/event/share/set_viewer_input/' -H 'Content-Type: application/json' -H 'Authorization: Basic <credentials>' -d '[ "Path 1", [ "A1", "B1" ] ]'Curl example multi item POST
curl 'https://devshare.tygron.com/api/event/share/set_viewer_input/' -H 'Content-Type: application/json' -H 'Authorization: Basic <credentials>' -d '[ [ "Path 1", "Path 2", "Path 3" ], [ [ "A1", "B1" ], [ "A2", "B2" ], [ "A3", "B3" ] ] ]'JavaScript example POST
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Basic <credentials>" },
body: '[ "Path 1", [ "A1", "B1" ] ]'
};
fetch("https://devshare.tygron.com/api/event/share/set_viewer_input/", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));