Api session query: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
Server@tygron.com (talk | contribs)
No edit summary
 
(65 intermediate revisions by 2 users not shown)
Line 1: Line 1:
API Endpoint: api/session/query/
API Base URL: api/session/query/


===GET {query}===
===GET {query}===
API Endpoint: api/session/query/{query}
API Endpoint: api/session/query/{query}
Content-Type: application/json


'''Parameters:'''
'''Parameters:'''
Line 39: Line 37:
|}
|}


===='''Examples====
====Examples====
'''SELECT_NAME_WHERE_CATEGORY_IS_SENIOR''':
'''SELECT_NAME_WHERE_CATEGORY_IS_SOCIAL''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SOCIAL?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
 
'''SELECT_NAME_WHERE_CATEGORY_IS_STUDENT''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_STUDENT?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
 
'''SELECT_NAME_WHERE_CATEGORY_IS_OFFICES''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_OFFICES?crs=4326&f=JSON&token=API_TOKEN</syntaxhighlight>
 
'''SELECT_FLOORSIZE_WHERE_CATEGORY_IS_BRIDGE_AND_MAP_IS_CURRENT''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_BRIDGE_AND_MAP_IS_CURRENT?crs=28992&f=JSON&token=API_TOKEN</syntaxhighlight>
 
'''SELECT_NAME_WHERE_CATEGORY_IS_PARK''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_PARK?crs=LOCAL&f=JSON&token=API_TOKEN</syntaxhighlight>


===POST query===
===POST query===
Line 101: Line 87:
|}
|}


===='''Examples====
====Examples====
'''Curl example POST''':
'''Curl example POST''':
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/query/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '"TQL Query 1"'
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/query/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '"TQL Query 1"'
Line 121: Line 107:
 .catch(error => console.log('error', error));
 .catch(error => console.log('error', error));
</syntaxhighlight>
</syntaxhighlight>
===GET SELECT_NAME_WHERE_CATEGORY_IS_SENIOR===
API Endpoint: api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SENIOR
Content-Type: application/json
'''Parameters:'''
{|class=wikitable
!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_SENIOR''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SENIOR?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
===GET SELECT_NAME_WHERE_CATEGORY_IS_STUDENT===
API Endpoint: api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_STUDENT
Content-Type: application/json
'''Parameters:'''
{|class=wikitable
!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_STUDENT''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_STUDENT?crs=3857&f=JSON&token=API_TOKEN</syntaxhighlight>
===GET SELECT_NAME_WHERE_CATEGORY_IS_OFFICES===
API Endpoint: api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_OFFICES
Content-Type: application/json
'''Parameters:'''
{|class=wikitable
!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_OFFICES''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_OFFICES?crs=4326&f=JSON&token=API_TOKEN</syntaxhighlight>
===GET SELECT_FLOORSIZE_WHERE_CATEGORY_IS_BRIDGE_AND_MAP_IS_CURRENT===
API Endpoint: api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_BRIDGE_AND_MAP_IS_CURRENT
Content-Type: application/json
'''Parameters:'''
{|class=wikitable
!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_FLOORSIZE_WHERE_CATEGORY_IS_BRIDGE_AND_MAP_IS_CURRENT''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_FLOORSIZE_WHERE_CATEGORY_IS_BRIDGE_AND_MAP_IS_CURRENT?crs=28992&f=JSON&token=API_TOKEN</syntaxhighlight>
===GET SELECT_NAME_WHERE_CATEGORY_IS_PARK===
API Endpoint: api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_PARK
Content-Type: application/json
'''Parameters:'''
{|class=wikitable
!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_PARK''':
<syntaxhighlight lang="text" copy>https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_PARK?crs=LOCAL&f=JSON&token=API_TOKEN</syntaxhighlight>


{{article end
{{article end

Latest revision as of 09:13, 23 November 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_SOCIAL:

https://engine.tygron.com/api/session/query/SELECT_NAME_WHERE_CATEGORY_IS_SOCIAL?crs=3857&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