- Legion API
- Fragment Types
- Get fragment types
Get fragment types
const url = 'https://us-gov.legion.picogrid.com/v2/fragments/types?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://us-gov.legion.picogrid.com/v2/fragments/types?paging_direction=forwards'Gets all the fragment types 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
Responses
Section titled “Responses”Success
object
object
This key can be used as a discriminator for which kind of fragment type you have received. In this case the value is ‘blob’, which has the extra file_extension property. See fragment_types documentation for more information.
object
This key can be used as a discriminator for which kind of fragment type you have received. In this case the value is ‘json’, which does not have any extra properties. See fragment_types documentation for more information.
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
{ "data": [ { "primitive_fragment_type": "blob" } ], "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
