- Legion API
- Terminals
- Get terminals for current user or token
Get terminals for current user or token
const url = 'https://legion.picogrid.com/v2/terminals?paging_direction=forwards';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://legion.picogrid.com/v2/terminals?paging_direction=forwards'Gets all terminals for the current user or token paginated
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The maximum number of items to return with a default value of 10. Note that a request never returns more than about 1MB of data irrespective of how high this value is
The cursor given by your previous request used to get the next page of results. Defaults to start from the beginning if forwards and end if backwards
The direction for the pagination cursor. Defaults to forwards
The id of the organization to get terminals for
Responses
Section titled “Responses”Success
object
object
Gives multiple different formats and units to choose between that all represent the location of the resource
object
Provides the latitude and longitude of the resource using WGS84, and the altitude of the resource in meters above sea level
object
The altitude of the resource in meters above sea level
object
Is false in this case which means you have reached the end of available results
object
Is true in this case which means there are more pages to be fetched
The cursor specifying your current pagination progress used to fetch next pages. Is only present if has_more is true
Example
{ "pagination": { "has_more": false }}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Bad Request Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Authentication Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Unauthorized Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Resource Not Found Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Timeout Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Bad Gateway Error
object
Examplegenerated
{ "message": "example"}Headers
Section titled “Headers”The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request’s credentials mode (Request.credentials) is include. - MDN Link
Version 2 · commit 0771262
