Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once the query has been sufficiently refined, set the and you desire to retrive all the available items, remove "page_size" to -1 and "page_number" from the request body. This will retrieve all the data, possibly be millions of records, for that query. Long wait times for a response can be expected depending on the size of the records and quality of connection (often 10mins or more).

...

Code Block
{
    "page_number": 1,
    "page_size": 205,
    "query": {
        "feature_type": [
            "http://linked.data.gov.au/def/tern-cv/b311c0d3-4a1a-4932-a39c-f5cdc1afa611"
        ]
    }
}

The above example has a page_number of 1 and a page_size of 20, which means that one page of results will be returned containing that contains twenty elements.

Response headers are returned Some platforms will also include response headers with information about the pagination settings that have been used:

Code Block
Pagination-Page: 1
Pagination-Size: 50
Pagination-Limit: 200 # Max number of page available. Notice that it could be smaller than the real number of pages due to the 10,000 limitation.
Pagination-Count: 11827 # Total amount of elements

...

Code Block
curl -X POST "https://ecoplots.tern.org.au/api/v1.0/foi/attributes?dformat=ndjson" -H "accept: */*" -H "X-Api-Key: aAbBcC...xXyYzZ" -H "Content-Type: application/json" -d "{\"page_numnumber\":1,\"page_size\":5,\"query\":{\"feature_type\":[\"http://linked.data.gov.au/def/tern-cv/b311c0d3-4a1a-4932-a39c-f5cdc1afa611\"]}}""

Once the query has been defined appropriately, remove pagination to retrieve the full set of elements.

...