Api session event editor source add service: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
API Endpoint: api/session/event/editorsource/add_service/
API Endpoint: api/session/event/editorsource/add_service/


Description: Add Service
Description: Add a new Service [[Source]], given a Geo Format, Name, URL and Uploader


{|class=wikitable
{|class=wikitable
!Name
!Index
!Importance
!Importance
!Type
!Type
Line 13: Line 13:
| REQUIRED
| REQUIRED
| (Enumeration)
| (Enumeration)
| geoformat
| Geo Format
| BGT_GML, CYCLO_IMAGE, DXF, ESRI_IMAGE, ESRI_JSON, GEOJSON, GEOPACKAGE, GEOTIFF, I3S, OSM, WCS_TIFF, WFS_GML, WFS_JSON  or  WMS_IMAGE
| BGT_GML, DXF, ESRI_IMAGE, ESRI_JSON, GEOJSON, GEOPACKAGE, GEOTIFF, I3S, OSM, WCS_TIFF, WFS_GML, WFS_JSON  or  WMS_IMAGE
|-
|-
| 1
| 1
| REQUIRED
| REQUIRED
| (String)
| (String)
| String
| Name
|  
|  
|-
|-
Line 25: Line 25:
| REQUIRED
| REQUIRED
| (String)
| (String)
| String
| URL
|  
|  
|-
|-
Line 31: Line 31:
| REQUIRED
| REQUIRED
| (String)
| (String)
| String
| Uploader Name
|  
|  
|}
|}
Line 40: Line 40:
|-
|-
| 200
| 200
| Integer (Integer)
| Integer (Service Source ID)
|-
|-
| 300-600
| 300-600
Line 46: Line 46:
|}
|}
===Example POST===
===Example POST===
Curl example POST:
Curl example POST
 
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editorsource/add_service/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "GEOJSON", "Name", "URL", "Uploader Name" ]'
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editorsource/add_service/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "GEOJSON", "Text", "Text", "Text" ]'
</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": "Bearer API_TOKEN" },
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ "GEOJSON", "Text", "Text", "Text" ]'
 body: '[ "GEOJSON", "Name", "URL", "Uploader Name" ]'
};
};
fetch("https://engine.tygron.com/api/session/event/editorsource/add_service/", options)
fetch("https://engine.tygron.com/api/session/event/editorsource/add_service/", options)

Latest revision as of 15:15, 11 November 2026

API Endpoint: api/session/event/editorsource/add_service/

Description: Add a new Service Source, given a Geo Format, Name, URL and Uploader

Index Importance Type Description Values
0 REQUIRED (Enumeration) Geo Format BGT_GML, DXF, ESRI_IMAGE, ESRI_JSON, GEOJSON, GEOPACKAGE, GEOTIFF, I3S, OSM, WCS_TIFF, WFS_GML, WFS_JSON or WMS_IMAGE
1 REQUIRED (String) Name
2 REQUIRED (String) URL
3 REQUIRED (String) Uploader Name

Response Codes

Response Code: Description
200 Integer (Service Source ID)
300-600 Codes Overview

Example POST

Curl example POST

curl 'https://engine.tygron.com/api/session/event/editorsource/add_service/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "GEOJSON", "Name", "URL", "Uploader Name" ]'

JavaScript example POST

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