Api session query: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 38: Line 38:


====Examples====
====Examples====
'''SELECT_COLOR_WHERE_CATEGORY_IS_LEISURE''':
'''SELECT_NAME_WHERE_CATEGORY_IS_ROAD''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_LEISURE?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_ROAD?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
 
'''SELECT_NAME_WHERE_CATEGORY_IS_NATURE''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_NATURE?crs=3857&f=HTML&token=API_TOKEN</syntaxhighlight>


'''SELECT_NAME_WHERE_CATEGORY_IS_UNDERGROUND''':
'''SELECT_COLOR_WHERE_CATEGORY_IS_SENIOR''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_UNDERGROUND?crs=3857&f=HTML&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>


'''SELECT_FLOORSIZE_WHERE_CATEGORY_IS_STUDENT_AND_MAP_IS_CURRENT''':
'''SELECT_NAME_WHERE_CATEGORY_IS_SENIOR''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_STUDENT_AND_MAP_IS_CURRENT?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=SMILE&token=API_TOKEN</syntaxhighlight>


'''SELECT_NAME_WHERE_CATEGORY_IS_LUXE''':
'''SELECT_NAME_WHERE_CATEGORY_IS_HEALTHCARE''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_LUXE?crs=3857&f=SMILE&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_HEALTHCARE?crs=3857&f=ZIPJSON&token=API_TOKEN</syntaxhighlight>


'''SELECT_FLOORSIZE_WHERE_CATEGORY_IS_NORMAL_AND_MAP_IS_MAQUETTE''':
'''SELECT_FLOORSIZE_WHERE_CATEGORY_IS_NORMAL_AND_MAP_IS_MAQUETTE''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_NORMAL_AND_MAP_IS_MAQUETTE?crs=3857&f=ZIPJSON&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_NORMAL_AND_MAP_IS_MAQUETTE?crs=3857&f=ZIPSMILE&token=API_TOKEN</syntaxhighlight>


'''SELECT_NAME_WHERE_CATEGORY_IS_SENIOR''':
'''SELECT_COLOR_WHERE_CATEGORY_IS_HEALTHCARE''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=ZIPSMILE&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_HEALTHCARE?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>


'''SELECT_NAME_WHERE_CATEGORY_IS_GARDEN''':
'''SELECT_COLOR_WHERE_CATEGORY_IS_OFFICES''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_GARDEN?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_OFFICES?crs=28992&f=JSON&token=API_TOKEN</syntaxhighlight>


'''SELECT_COLOR_WHERE_CATEGORY_IS_INTERSECTION''':
'''SELECT_COLOR_WHERE_CATEGORY_IS_EDUCATION''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_INTERSECTION?crs=4326&f=JSON&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_EDUCATION?crs=LOCAL&f=JSON&token=API_TOKEN</syntaxhighlight>


'''SELECT_NAME_WHERE_CATEGORY_IS_ROAD''':
===POST query===
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_ROAD?crs=28992&f=JSON&token=API_TOKEN</syntaxhighlight>
API Endpoint: api/session/query/


'''SELECT_COLOR_WHERE_CATEGORY_IS_BRIDGE''':
Content-Type: application/x-www-form-urlencoded
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_BRIDGE?crs=LOCAL&f=JSON&token=API_TOKEN</syntaxhighlight>
 
'''Parameters:'''
{|class=wikitable
!Name
!Location
!Type
!Default value
|-
| f
| Query
| [[Format]]
| JSON
|-
| crs
| Query
| String
| EPSG:3857
|}


===POST query===
===POST query===
Line 111: Line 131:
 .catch(error => console.log('error', error));
 .catch(error => console.log('error', error));
</syntaxhighlight>
</syntaxhighlight>
===POST query===
API Endpoint: api/session/query/
Content-Type: application/x-www-form-urlencoded
'''Parameters:'''
{|class=wikitable
!Name
!Location
!Type
!Default value
|-
| f
| Query
| [[Format]]
| JSON
|-
| crs
| Query
| String
| EPSG:3857
|}


{{article end
{{article end

Revision as of 12:12, 14 October 2026

API Base URL: api/session/query/

GET {query}

API Endpoint: api/session/query/{query}

Parameters:

Name Location Type Default value
query Path String
value Query String 0.0
f Query Format JSON
validate Query boolean false
crs Query String EPSG:3857

Examples

SELECT_NAME_WHERE_CATEGORY_IS_ROAD:

https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_ROAD?crs=3857&f=JSON&token=API_TOKEN

SELECT_NAME_WHERE_CATEGORY_IS_NATURE:

https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_NATURE?crs=3857&f=HTML&token=API_TOKEN

SELECT_COLOR_WHERE_CATEGORY_IS_SENIOR:

https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=JSON&token=API_TOKEN

SELECT_NAME_WHERE_CATEGORY_IS_SENIOR:

https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=SMILE&token=API_TOKEN

SELECT_NAME_WHERE_CATEGORY_IS_HEALTHCARE:

https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_HEALTHCARE?crs=3857&f=ZIPJSON&token=API_TOKEN

SELECT_FLOORSIZE_WHERE_CATEGORY_IS_NORMAL_AND_MAP_IS_MAQUETTE:

https://engine.tygron.com/api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_NORMAL_AND_MAP_IS_MAQUETTE?crs=3857&f=ZIPSMILE&token=API_TOKEN

SELECT_COLOR_WHERE_CATEGORY_IS_HEALTHCARE:

https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_HEALTHCARE?crs=3857&f=JSON&token=API_TOKEN

SELECT_COLOR_WHERE_CATEGORY_IS_OFFICES:

https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_OFFICES?crs=28992&f=JSON&token=API_TOKEN

SELECT_COLOR_WHERE_CATEGORY_IS_EDUCATION:

https://engine.tygron.com/api/session/query/SELECT_COLOR_WHERE_CATEGORY_IS_EDUCATION?crs=LOCAL&f=JSON&token=API_TOKEN

POST query

API Endpoint: api/session/query/

Content-Type: application/x-www-form-urlencoded

Parameters:

Name Location Type Default value
f Query Format JSON
crs Query String EPSG:3857

POST query

API Endpoint: api/session/query/

Content-Type: application/json

Parameters:

Name Location Type Default value
f Query Format JSON
crs Query String EPSG:3857

Examples

Curl example POST:

curl 'https://engine.tygron.com/api/session/query/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '"TQL Query 1"'

Curl example multi item POST:

curl 'https://engine.tygron.com/api/session/query/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "TQL Query 1", "TQL Query 2", "TQL Query 3" ]'

JavaScript example POST:

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

See also