API
  • API Index
  • Batch API
  • Content Negotiation
  • Dynamic Paths
  • Hierarchy API
  • List API
  • Quick Reference
  • Time Series API
  • Views
    • Configuration
  • Overview
  • Application Configuration
  • Documentation Configuration
  • Spec Configuration
    • Features
  • API Testing
  • Asynchronous Processing
  • Cassandra Time-Series Engine
  • Cassandra Integration
  • Default Controller Customisation
  • Documentation
  • Geospatial Filtering
  • Model Documentation
  • PostgreSQL Integration
  • Excel Spreadsheet Format
    • Tutorials
  • Step-by-Step Guide
  • Archetype Setup
  • Logging
  • Prometheus
  • Sentry Logging
    • UI Customisation
  • UI Customisation
  • SASS Build Chain
  • Shared Layout
  • API Documentation
  • Model Documentation
  • Results
  • sapi-nt v current

    Content Negotiation

    You can use standard content negotiation to request API results in specific formats. Sapi-NT supports - in order of priority - query parameter, path extension and Accept header based content negotiation.

    By default, each endpoint supports the following content types:

    Name Media Type
    html text/html
    json application/json
    csv text/csv
    ttl text/turtle
    rdf application/rdf+xml

    Some endpoints also support GeoJSON:

    Name Media Type
    geojson application/geo+json

    If the Sapi-NT application supports Excel spreadsheet format (XLS):

    Name Media Type
    xls application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

    Query Parameter

    You can request a specific format by supplying the _format query parameter. The value should be the name of a content type described above.

    Example

    /path/example?_format=json
    

    Path Extension

    You can request a specific format by including a path extension in the request URL. The extension should be the name of a content type described above.

    Example

    /path/example.json
    

    Accept Header

    You can request one or more specific formats by supplying Accept header values. Each value should be the full media type of a content type described above.

    Example

    curl -i -H "Accept: text/csv" /path/example