Koordinates API Documentation (1.0.1)

Download OpenAPI specification:Download

Documentation for Koordinates REST APIs.

Expansions

Expansions (sometimes known as “side-loads”) provide a way to include related content into a particular API view. For many property values, we supply a URL to the resource. For example:

{
  "id": 4,
  "url": "https://{domain}/services/api/v1/layers/1/",
  "type": "layer",
  "name": "Road Centerlines",
  "permissions": "https://{domain}/services/api/v1/layers/4/permissions/",
  ...

The permissions property points to a URL where we can see the permissions for this layer. We can include the permissions response directly in this request by including an Expand header with the value permissions.

  Expand: permissions

More than one expansion can be requested by providing property names separated by commas.

A list of available expansions for any particular view is accessible via an OPTIONS request. This will return an object that contains the key expansions and an array of valid expansion options. For example:

  {
      "name": "Layer Detail",
      "expansions": [
          "permissions"
      ]
  }

Some list views can provide more detailed responses via the special list expansion. Note that list expansions cannot be used in conjunction with detailed item expansions.

API Tokens

APIs for created and managing API tokens. Valid scopes:

  • query – Query layer data
  • tiles – Access cartographic tile images (WMTS)
  • catalog – View the data catalog and access catalog services (CS-W)
  • wxs:wfs – Access OGC Web Feature Services (WFS)
  • documents:read – Search and view documents
  • documents:write – Create, edit and delete documents
  • layers:read – Search and view tables and layers
  • layers:write – Create, edit and delete tables and layers
  • notifications:read – Retrieve notifications
  • sets:read – Search and view sets
  • sets:write – Create, edit and delete sets
  • sources:read – Search and view data sources
  • sources:write – Create, edit and delete data sources
  • exports:read – Search, view and download exported data
  • exports:write – Create new data exports
  • users:read – View group and user information
  • users:write – Manage users and groups
  • tokens:read – View your API tokens
  • tokens:write – Manage your API tokens
  • repos:read – Search and view Kart repos
  • repos:push – Push commits to Kart repos
  • repos:write – Create, edit and delete Kart repos
  • viewers:read – Search and view MapViewers
  • viewers:write – Create, edit and delete MapViewers

List API Tokens

Authorizations:
SessionAuthenticationNone

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an API Token

Authorizations:
SessionAuthenticationNone

Get API Token

Authorizations:
SessionAuthenticationNone

Responses

Response samples

Content type
application/json
{
  • "id": 531,
  • "name": "Example Token",
  • "key_hint": "0035ee...",
  • "site": "example.koordinates.com",
  • "scope": "layers:read documents:read",
  • "created_at": "2019-08-24T14:15:22Z",
  • "expires_at": "2019-08-24T14:15:22Z",
  • "referrers": [
    ]
}

Update an API Token

Authorizations:
SessionAuthenticationNone

Delete an API Tokens

Authorizations:
SessionAuthenticationNone

Categories

Get categories

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[]

Create a new category

Authorizations:
SessionAuthentication
Request Body schema: application/json
name
required
string
slug
string

A URL-friendly name for the category. Will be generated automatically if not provided. Must be unique within the current set of children.

parent
string <url>

The URL of the parent category.

Request samples

Content type
application/json
{
  • "name": "Category 1",
  • "slug": "string",
  • "parent": "string"
}

Fetch a single category

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Update a category

Authorizations:
SessionAuthentication
Request Body schema: application/json
subject
string
slug
string

A URL-friendly name for the category. Will be generated automatically if not provided. Must be unique within the current set of children.

parent
string <url>

The URL of the parent category.

Responses

Request samples

Content type
application/json
{
  • "subject": "Category 1",
  • "slug": "string",
  • "parent": "string"
}

Response samples

Content type
application/json
{}

Delete a category

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
null

Coordinate Systems

List available coordinate systems

query Parameters
kind
string (CoordinateSystemKind)
Enum: "geographic 2D" "geocentric" "geographic 3D" "projected" "vertical" "compound"
q
string
Example: q=pacific+ocean

Free text search query

Responses

Response samples

Content type
application/json
[]

Retrieve information about a coordinate system

path Parameters
id
required
any
Example: EPSG:4326

Responses

Response samples

Content type
application/json
{
  • "id": "EPSG:4326",
  • "name": "WGS 84",
  • "kind": "geographic 2D",
  • "unit_horizontal": "degree",
  • "unit_vertical": null,
  • "url_external": "https://epsg.io/4326",
  • "srid": 4326,
  • "definition": "GEOGCRS[\"WGS 84\",DATUM[\"World Geodetic System 1984\",ELLIPSOID[\"WGS 84\",6378137,298.257223563,LENGTHUNIT[\"metre\",1]]],PRIMEM[\"Greenwich\",0,ANGLEUNIT[\"degree\",0.0174532925199433]],CS[ellipsoidal,2],AXIS[\"geodetic latitude (Lat)\",north,ORDER[1],ANGLEUNIT[\"degree\",0.0174532925199433]],AXIS[\"geodetic longitude (Lon)\",east,ORDER[2],ANGLEUNIT[\"degree\",0.0174532925199433]],USAGE[SCOPE[\"Horizontal component of 3D system.\"],AREA[\"World.\"],BBOX[-90,-180,90,180]],ID[\"EPSG\",4326]]\n"
}

Data Object Identifiers

DOIs – or Data Object Identifiers – are unique addresses assigned to a piece of digital content. They are intended to provide a persistent link to its location on the internet. Koordinates supports manually assigned DOIs and supports DOI "minting" and integrated management with the DataCite registry service.

For sites that have this feature enabled, the Data Object Identifiers API is an extension to Layer, Table and Document APIs. For more information about enabling Data Object Identifier support to your site, please contact support@koordinates.com.

DOI Representations

DOIs can be defined in the following ways:

  • As a basic prefix/suffix of the form 10.5072/FK2SJ1J03K
  • As a URL https://doi.org/10.5072/FK2SJ1J03K
  • As a name-spaced DOI string doi:10.5072/FK2SJ1J03K

Any of these forms is considered an acceptable way to supply DOI strings to the API. You can also supply one or more of these in an object keyed by url or identifier as long as they are equivalent.

Get Layer DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Auto-Create or Set Layer DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
any (CreateDOIRequest)

Responses

Request samples

Content type
application/json
null

Response samples

Content type
application/json
{}

Get Document DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Auto-Create or Set Document DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
any (CreateDOIRequest)

Responses

Request samples

Content type
application/json
null

Response samples

Content type
application/json
{}

Data Sources

The Data Sources API provides read and write access to sources, datasources and scans.

Source-specific notes

There are several types of sources. Each exposes the same set of core fields, but some fields are only exposed or accepted for specific types of sources. Everything in options is optional.

Info sources

Info sources merely provide a way to point humans to some data. They are never scanned by Koordinates; they don’t have datasources; and you can’t create layers from them.

CIFS, URL, ArcGIS, and WFS source options

All these source types can accept credentials in an options field:

  • options:
    • username : username to access this server.
    • password : password for this server.
    • ssl_verify : A boolean specifying whether Koordinates should verify the SSL certificate of the host when scanning this source. Defaults to true. Username and password are write-only. They are never returned to clients via the API.

ArcGIS Server

  • url_remote : The URL of your ArcGIS server, usually ending with/rest/api/services/. Must not contain credentials.

  • options : In addition to the options listed above, ArcGIS also accepts:

    • folders : A JSON array of folders to scan. If not given, the whole server will be scanned.

CIFS

  • url_remote : A URL of the form "cifs://host/sharename", optionally with extra path segments. Must not contain credentials.

PostgreSQL

  • url_remote : A URL of the form "postgresql://host:port/database". Must not contain credentials.

  • options :

    • username : username to access the PostgreSQL database.
    • password : postgres database password.
    • schemas : A JSON array containing schema names, e.g.: "schemas": ["public", "other_schema"]

URL

A URL source defines an FTP, HTTP or HTTPS url to an archive Koordinates can scan for data.

Currently accepts these archives:

  • .zip
  • .tar.gz, .tgz
  • .7z

URL sources accept the following extra fields:

  • url_remote : The URL to download the archive. Must not contain credentials.

WFS Server

  • url_remote : The URL to the WFS server endpoint. Must not contain credentials.

List Sources

Returns a list of all the sources available to you.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "harbour-images.zip",
  • "type": "upload",
  • "description": "",
  • "description_html": "",
  • "categories": "string",
  • "user": {
    },
  • "last_scanned_at": null,
  • "scan_schedule": null,
  • "options": "{}",
  • "metadata": null
}

Create a Source

To create a source, post to this view.

Parameters

  • type: string (required). The type of source to create. Example: info. Choices: info upload cifs arcgis wfs postgres
  • name: string (required). The name of the new source.
  • group: string|id(optional)
  • user: string|id (optional). The group or user (at least one required) that owns the source, by ID or API URL.
  • url_remote: string (optional). The remote URL to the source, not required for info or uploadsources
  • options: object (optional). Refer to the source specific notes above.
  • scan_schedule: string (optional). A Cron expression specifying how frequently the source should be scanned. All normal cron values are supported but the ‘minutes’ value is currently ignored. Predefined scheduling definitions are supported except for "@reboot".
Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
name
string
type
string
description
string
categories
string
user
number
object (SourcePostOptions)
url_remote
string <url>
scan_schedule
string

Responses

Request samples

Content type
application/json
{
  • "name": "Bob's ArcGIS 10 Server",
  • "type": "arcgis",
  • "description": "All of Bob's data",
  • "categories": "string",
  • "user": 3,
  • "options": {
    },
  • "scan_schedule": "@daily"
}

Response samples

Content type
application/json
{}

Get source detail

Returns details of a source.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Edit a source

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
description
string

Request samples

Content type
application/json
{
  • "description": "Harbour Imagery (4m/px)"
}

List scans

Returns a list of scans for a source.

Notable fields:

status : The current status of this scan. Valid values are:

running completed cancelled error change_counts : counts of datasources deleted, updated and added in this scan. This is only guaranteed to be present in completed scans. For other scans it may be null or the counts may all be 0. tags:

  • Data Sources security:
  • SessionAuthentication: []
  • HeaderTokenAuthentication: [] operationId: getSourceScans responses: '200': description: OK content: application/json: schema: $ref: '#/schemas/SourceScans'

Start scan

Starts a scan for this source. No post data is required.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Get scan detail

Information about a particular scan. This is the same as an item in the list view above, except it also includes a progress indicator, which is a float between 0 and 1. Progress is approximate.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Cancel or delete scan

Cancels an in-progress scan.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Get scan log

Gets a log for a scan. By default this is returned as text/plain, but you can request JSON via the Accept header.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

List datasources

Lists datasources for this source.

The API for datasources is read-only. Datasources are updated by scanning your source. If you don't see what you expect here, check that your source has been scanned recently.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "",
  • "data_type": "vector",
  • "geometry_type": "polygon",
  • "updated_at": "2013-10-13T02:53:46Z",
  • "arcgis_folder_service_path": "Bob/MapServer",
  • "arcgis_geometry_type": "esriGeometryPolygon",
  • "arcgis_layer_name": "Null Island",
  • "arcgis_type": "Feature Layer"
}

Get datasource detail

Detailed information for a given datasource. Includes all the info shown in the list above, as well as much more information describing the datasource.

Field notes

  • type is the source type, not to be confused with data_type, format or geometry_type

  • data_type refers to the broad type of data. Different types of data require significantly different handling. Current data types are:

    • table
    • vector
    • raster
    • grid
    • attribute-grid
  • format is a string describing the media type of this datasource.

  • geometry_type describes the type of geometry in vector datasources. It is null for non-vector datasources. Possible values are:

  • point

  • linestring

  • polygon

  • multipoint

  • multilinestring

  • multipolygon

  • Spatial datasources may or may not have a known Coordinate Reference System (crs).

  • extent is a GeoJSON geometry. It may be null for aspatial datasources. The coordinate system for this geometry is the same as that in the crs field, which may not be known.

  • For vector and table datasources, fields is a list of JSON objects. It will be null for other datasources.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Null Island Polygons",
  • "data_type": "vector",
  • "geometry_type": "polygon",
  • "updated_at": "2012-11-14T02:53:46Z",
  • "format": "application/json",
  • "crs": "EPSG:4326",
  • "fields": [
    ],
  • "num_dims": "2,",
  • "num_features": "1500,",
  • "num_bands": "null,",
  • "extent": { },
  • "metadata": "null,",
  • "arcgis_folder_service_path": "Bob/MapServer",
  • "arcgis_geometry_type": "esriGeometryPolygon",
  • "arcgis_layer_name": "Geology",
  • "arcgis_type": "Feature Layer"
}

Get datasource metadata

Some datasources can have attached XML metadata. This is attached by the CIFS and Upload scanners, if a datasource has an .xml file with the same basename. For example:

my-points-with-metadata.geojson my-points-with-metadata.xml As with sources, datasource XML must be in one of these three formats:

  • ISO 19115/19139
  • FGDC CSDGM
  • Dublin Core

Response Body

<dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
  <title></title>
  <creator>Bob Jones and Associates</creator>
  <subject>hydro</subject>
  <description>Some nice colourful aerial photos of the Auckland Harbour.</description>
  <date>2013-01-01</date>
  <type>raster</type>
  <language>eng</language>
</dc>
Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "creator": "Bob Jones and Associates",
  • "subject": "hydro",
  • "description": "Some nice colourful aerial photos of the Auckland Harbour.",
  • "date": "2013-01-01",
  • "type": "raster",
  • "language": "string"
}

Documents

Document API

Get Document DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Auto-Create or Set Document DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
any (CreateDOIRequest)

Responses

Request samples

Content type
application/json
null

Response samples

Content type
application/json
{}

Delete a source

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Delete Documents

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Create document version

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
name
string
user
string <url>
data
object

Request samples

Content type
application/json
{}

Explore

Exports

Returns a list of exports you've created.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create and start a new export

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
crs
required
string

The coordinate reference system in the form EPSG:XXXX where XXXX is the identifier. For more info on EPSG, refer to http://epsg.io. Please note that KML exports can only be exported in WGS84 / EPSG:4326.

formats
required
object

An object keyed by layer or table "kind" (see Layers & tables API kind property) with the mimetype of the format you want in the download. You must have one entry for each data kind you are exporting.

required
Array of objects (ExportDatasetItemList) >= 0

A list of layer, table or dataset items to export.

name
string

The name for the archive. If not provided this will be generated from the content.

extent
string

A Crop Feature or Geometry extent for cropping to a specific geographic area.

options
object

Additional format options

object

Delivery details (omit this when creating a downloadable export)

Request samples

Content type
application/json
{
  • "crs": "EPSG:26767",
  • "formats": {
    },
  • "items": [
    ],
  • "name": "string",
  • "extent": "string",
  • "options": { },
  • "delivery": {
    }
}

Get available export options

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "actions": {
    }
}

Validate export request

The Export Validation endpoint accepts the same content as the Export Creation API but will not create/start the export and will return additional information.

Error Codes

The following errors are returned as part of a 400 response when the validation request itself fails. The paths below indicate where the error will be found in the nested respone, for example:

  {
    "error_code": 400,
    "errors": {
      "items": [
        `no-items: You must request at least one item`
      ]
    }
  }
  • errors
    • items
      • no-items: You must request at least one item \
      • duplicate-items: Duplicate items were requested
      • [index]
        • item
          • Invalid hyperlink - No URL match.
    • crs
      • Invalid CRS
      • Unknown CRS
  • formats
    • No format was selected for layers of type '{kind}'

The following error codes are returned as part of a 200 response which will include other information about the Export validation.

  • invalid_reasons

    • kml-invalid-crs
    • missing-crs
    • no-layers
    • over-size-limit:max-{overall-size-limit}
    • under-sized-courier-export:min-{overall-size-limit}
    • over-size-limit:{mime-type}:max-{format-size-limit}
    • missing-shipping_address-field:{field_name}
  • items

    • [index]
      • invalid_reasons
        • commercial-data-not-supported
        • outside-extent
        • online-only
        • invalid-for-given-crs
Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
crs
required
string

The coordinate reference system in the form EPSG:XXXX where XXXX is the identifier. For more info on EPSG, refer to http://epsg.io. Please note that KML exports can only be exported in WGS84 / EPSG:4326.

formats
required
object

An object keyed by layer or table "kind" (see Layers & tables API kind property) with the mimetype of the format you want in the download. You must have one entry for each data kind you are exporting.

required
Array of objects (ExportDatasetItemList) >= 0

A list of layer, table or dataset items to export.

name
string

The name for the archive. If not provided this will be generated from the content.

extent
string

A Crop Feature or Geometry extent for cropping to a specific geographic area.

options
object

Additional format options

object

Delivery details (omit this when creating a downloadable export)

Responses

Request samples

Content type
application/json
{
  • "crs": "EPSG:26767",
  • "formats": {
    },
  • "items": [
    ],
  • "name": "string",
  • "extent": "string",
  • "options": { },
  • "delivery": {
    }
}

Response samples

Content type
application/json
{}

Feedback

Groups

List Groups

Get the groups configured for this site.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
query Parameters
q
string

Free-text search query

access_requests_enabled
boolean

Filter groups with or without access requests

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a Group.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "url": "string",
  • "name": "string",
  • "country": "string",
  • "org": "string",
  • "access_requests_enabled": true
}

List Group User Permissions

Returns a list of permissions granted to users within this group.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[]

Modify Group User Permissions

Allows the caller to make multiple changes to the group permissions. Each action in the list has one of three action types that can be performed:

  • create - add a new permission for a user to this group
  • update - modify the permissions for an existing permission
  • delete - delete a permission that currently exists

The update and delete operations require the url to the permission as returned in the GET request to this endpoint. The value object specifies the user (by ID) and the permission to grant.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
Array
action
string
Enum: "create" "update" "delete"
object
url
string

Required for update and delete actions.

Responses

Request samples

Content type
application/json
[]

Add Group User Permissions

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
permission
string
Enum: "view" "manage_data" "admin"
user
number

Responses

Request samples

Content type
application/json
{
  • "permission": "view",
  • "user": 99999
}

Get User Group Permission

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Update User Group Permission

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
permission
string
Enum: "view" "manage_data" "admin"
user
number

Responses

Request samples

Content type
application/json
{
  • "permission": "view",
  • "user": 99999
}

Response samples

Content type
application/json
{}

Delete User Group Permission

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Current User Access Request

Fetches an existing access request to the group for the currently authenticated user.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Request Access to Group

Submit an access request to the group for the currently authenticated user.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Revoke Access Request

Revokes the access request for the currently authenticated user.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Get Access Request List

Fetches all outstanding access requests for the group.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[]

Get Access Request

Fetches an access requests for the group.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Decline Access Request

Declines a users request to access the group. This will notify the requesting user that the request has been declined.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Approve Access Request

Approves a request to access the group. The user will be notified that the request has been approved.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Layers & Tables

Layer APIs

List layers and tables

List layers (at layers/) and tables (at tables/) respectively. List views follow the Catalog API semantics.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[]

Post layers or tables

All fields except name and data.datasources are optional.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
title
required
string
description
string
collected
string <date>
object (LayersLicenseSerializer)
supplier_reference
string
version_reference
string
default_style_id
integer
publish
boolean
mapstream_id
integer
categories
string
tags
Array of arrays
permissions
string <uri>
publish_to_catalog_services
boolean
object (LayersAutoupdateSerializer)
required
object (LayersDataSerializer)
tilegrids
Array of arrays

Responses

Request samples

Content type
application/json
{
  • "title": "Fictional Boundary Points",
  • "description": "These points are totally fictional!",
  • "collected": "2013-01-01",
  • "license": {},
  • "supplier_reference": "TIVPAS",
  • "version_reference": "added more data",
  • "default_style_id": 3,
  • "publish": true,
  • "mapstream_id": 3,
  • "categories": "topographic/nz-topo-offshore-islands-data/terrain",
  • "tags": "tag2, tag2",
  • "permissions": "topographic/nz-topo-offshore-islands-data/terrain",
  • "publish_to_catalog_services": true,
  • "autoupdate": {
    },
  • "data": {
    },
  • "tilegrids": "[]"
}

Response samples

Content type
application/json
{}

Get a filterable list view of layers

A filterable list views of layers (layers/drafts/) and and tables (tables/drafts/) respectively, similar to /layers/ and /tables/. This view shows the draft version of each layer or table. If the most recent version of a layer or table has been published already, it will not appear here.

All the same filters and ordering from layers/ and tables/ apply.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Get details of a layer or a table

Displays details of a layer layers/{id}/ or a table tables/{id}/. This view displays the published version only. To get the latest version, hit /layers/{id}/versions/latest/

Both of these URLs work for either layers or tables. This is because layers can be turned into tables and vice versa. If /tables/123/ is hit for a layer, or /layers/123/ for a table, the behaviour and response will be the same as the “correct” URL, except that the response will contain a Location header specifying the canonical URL. This applies to all sub-urls also (permissions/, metadata/, versions/, etc)

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Delete a layer

Deletes specified layer.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Filterable view of a specific layer or table versions

Filterable list views of versions of a specific layer or table, always sorted newest to oldest.

Parameters data__source_revision: number (optional). If the version s source supports revisions, find versions using a specific revision. Values depend on the source type. Optionally use data__source_revision__lt ordata__source_revision__gte to filter using < or >= operators respectively.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Create a new draft version

Creates a new draft version, accepting the same content as POST layers/. If anything in the data object has changed then an import will begin immediately. Otherwise to force a re-import from the previous sources call layers/{id}/versions/{version}/import/.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
title
string
description
string
collected
string <date>
object
supplier_reference
string
version_reference
string
default_style_id
integer
publish
boolean
object
categoties
string <uri>
tags
Array of strings
permissions
string <uri>
publish_to_catalog_services
boolean
object (LayersAutoupdateSerializer)
object (LayersDataSerializer)
tilegrids
string
default_style
integer

Responses

Request samples

Content type
application/json
{
  • "title": "Fictional Boundary Points",
  • "description": "These points are totally fictional!",
  • "collected": [
    ],
  • "license": {},
  • "supplier_reference": "TIVPAS",
  • "version_reference": "added more data",
  • "default_style_id": 3,
  • "publish": true,
  • "user": {
    },
  • "categoties": [
    ],
  • "tags": [
    ],
  • "publish_to_catalog_services": true,
  • "autoupdate": {
    },
  • "data": {
    },
  • "tilegrids": "EPSG:2193",
  • "default_style": 10
}

Response samples

Content type
application/json
{ }

Get Layer DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Auto-Create or Set Layer DOI

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
any (CreateDOIRequest)

Responses

Request samples

Content type
application/json
null

Response samples

Content type
application/json
{}

Licenses

Get licenses

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[]

Create a new custom license

Note that only custom licenses can be created.

Authorizations:
SessionAuthentication
Request Body schema: application/json
title
string
text
string

Body of the license text.

slug
string

URL-friendly name for this license. Will be generated automatically if not provided.

url_external
string

Request samples

Content type
application/json
{
  • "title": "The Unlicense",
  • "text": "string",
  • "slug": "string",
  • "url_external": "string"
}

Fetch a single license

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{}

Update a custom license

Note that only custom licenses can be updated.

Authorizations:
SessionAuthentication
Request Body schema: application/json
title
string
text
string
slug
string

URL-friendly name for this license. Will be generated automatically if not provided.

url_external
string
description
string
collected
string <date>
object (LayersLicenseSerializer)
supplier_reference
string
version_reference
string
default_style_id
number
publish
boolean
mapstream_id
number
categories
string
tags
Array of arrays
permissions
string <url>
publish_to_catalog_services
boolean
object (LayersAutoupdateSerializer)
required
object (LayersDataSerializer)
tilegrids
Array of arrays

Responses

Request samples

Content type
application/json
{
  • "title": "The Unlicense",
  • "text": "string",
  • "slug": "string",
  • "url_external": "string",
  • "description": "These points are totally fictional!",
  • "collected": "2013-01-01",
  • "license": {},
  • "supplier_reference": "TIVPAS",
  • "version_reference": "added more data",
  • "default_style_id": 3,
  • "publish": true,
  • "mapstream_id": 3,
  • "categories": "topographic/nz-topo-offshore-islands-data/terrain",
  • "tags": "tag2, tag2",
  • "permissions": "topographic/nz-topo-offshore-islands-data/terrain",
  • "publish_to_catalog_services": true,
  • "autoupdate": {
    },
  • "data": {
    },
  • "tilegrids": "[]"
}

Response samples

Content type
application/json
{}

Delete a custom license

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
null

Pinning

Pin dataset

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Un-pin dataset

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Raster Query

The Raster Query API allows users to request information related to a point location from one or more Koordinates grid or raster datasets.

URL

Your URL endpoint is dependent on the particular Koordinates service you wish to access.

The URL for the Koordinates.com will be: https://koordinates.com/services/query/v1/raster

The raster query API returns in JSON:

content-type: application/vnd.koordinates.rasterQuery+json Formats can be specified via URL. For example: https://koordinates.com/services/query/v1/raster.json

They can also be specified using the HTTP Accept header with the appropriate content-type against the base URL. For example: application/vnd.koordinates.rasterQuery.1+json.

By default, all responses use the newest format. While we try very hard to prevent backwards-incompatible breaks, please note that it may happen in future.

If you're using the URL endpoint (for example, rasterQuery.json) you can pass a &v=1 parameter to specify version 1. Note that the current version is 1.

Compression

Add a request header with Accept-Encoding: gzip to get compressed results. This dramatically reduces the size of the response and will speed up your API requests.

Get information from grid or raster datasets

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
key
required
string

Your Koordinates API key

layer
required
integer

The ID of the raster or grid layer to get results from

x
required
number

Longitude of the point you want to query

y
required
number

Latitude of the point you want to query

callback
boolean

Only available for JSON formats. If supplied, will use the JSONP format with a callback of the given name

Request samples

Content type
application/json
{
  • "key": 1,
  • "layer": 1132,
  • "x": -41.27831,
  • "y": 174.77694,
  • "callback": false
}

Services

Services

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Sets

The Set Query API allows users to look up a point location and get back information from a set.

A set is a collection of data layers and tables that can be viewed downloaded at one time. Publishers use sets to enable users to access datasets that are commonly grouped together.

Differences to vector and raster APIs

The set query API returns similar information to the Vector and Raster API endpoints, with a few notable differences

  • You query a single set, not a number of layers. You don't have to know what layers are in the set before you query it.
  • Layers are returned in the correct order, in a JSON list rather than an object. Both vector and grid layers from the set will be included.
  • Each layer returned contains its ID and title, since you might not already have them.

    URL

    Your URL endpoint is dependent on the particular Koordinates service you wish to access.

The URL for the Koordinates site will be https://koordinates.com/services/query/v1/set

Formats

The sets API returns in JSON:

content-type: application/vnd.koordinates.setQuery+json

Formats can be specified via URL. For example: http://api.koordinates.com/api/setQuery.json

They can also be specified using the HTTP Accept header with the appropriate content-type against the base URL. For example: application/vnd.koordinates.rasterQuery.1+json

By default, all responses use the newest format. While we try very hard to prevent backwards-incompatible breaks, please note that it may happen in future

If you're using the URL endpoint (for example, rasterQuery.json) you can pass a &v=1 parameter to specify version 1.3. Note that the current version is 1.3

Compression

Add a request header with Accept-Encoding: gzip to get compressed results. This dramatically reduces the size of the response and will speed up your API requests.

Get information from a set

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "x": 0,
  • "y": 0,
  • "radius": 100,
  • "geometry": false,
  • "with_field_names": false,
  • "set required": 0,
  • "max_result": 1
}

Sites

Returns details for the current site (warehouse)

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "owner": "string",
  • "owner_short": "string",
  • "domain": "example.koordinates.com",
  • "copyright": "string",
  • "ui_version": "string",
  • "theme": {
    },
  • "user_menus": [
    ],
  • "help_menus": [
    ],
  • "hs_property_id": "string",
  • "ecommerce": true,
  • "flags": { },
  • "geocoder": { },
  • "basemap": { },
  • "sentry_dsn": "string",
  • "org_url": "string",
  • "tile_cdn_urls": "string",
  • "tilegrids": [
    ],
  • "geotag": {
    }
}

Returns a list of access requests for the current site.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new site access request

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
user_id
required
number

ID of the user the request is tied to

Responses

Request samples

Content type
application/json
{
  • "user_id": 0
}

Response samples

Content type
application/json
{
  • "status": "pending",
  • "url": "string",
  • "id": 0,
  • "created_by": {
    },
  • "updated_by": {
    },
  • "user": {
    },
  • "created_at": "2020-05-16T23:37:45.632286Z",
  • "updated_at": "2020-05-16T23:37:45.632286Z"
}

Get custom user menus

Authorizations:
SessionAuthentication

Responses

Response samples

Content type
application/json
{
  • "user_menus": [
    ]
}

Update custom user menus

Request Body schema: application/json
Array of objects

Responses

Request samples

Content type
application/json
{
  • "user_menus": [
    ]
}

Response samples

Content type
application/json
{
  • "user_menus": [
    ]
}

Get custom help menu URLs

Authorizations:
SessionAuthentication

Responses

Response samples

Content type
application/json
{
  • "help_menus": [
    ]
}

Update custom help menu URLs

Request Body schema: application/json
Array of objects

Responses

Request samples

Content type
application/json
{
  • "help_menus": [
    ]
}

Response samples

Content type
application/json
{
  • "help_menus": [
    ]
}

Users

User APIs

Get the currently logged in user's details

Returns detail about the user who is currently authenticated with the API.

Authorizations:
SessionAuthenticationHeaderTokenAuthentication

Responses

Response samples

Content type
application/json
{
  • "id": 482,
  • "first_name": "Jennifer",
  • "last_name": "Exampleton",
  • "country": "US",
  • "email": "jennifer.exampleton@example.com",
  • "is_locked": false,
  • "is_site_admin": false,
  • "seat_type": "none",
  • "date_joined": "2020-05-16T23:37:45.632286Z",
  • "avatar_url": "string",
  • "capabilities": {
    },
  • "contexts": [
    ],
  • "remote_auth": false,
  • "remote_auth_org": {},
  • "locale": "en-US",
  • "geoip": {
    },
  • "is_authenticated": true,
  • "notification_preferences": {
    }
}

Vector Query

The Vector Query API allows users to request information related to a point location from one or more Koordinates vector datasets.

URL

Your URL endpoint is dependent on the particular Koordinates service you wish to access.

The URL for Koordinates.com site will be: https://koordinates.com/services/query/v1/vector

Formats

The vector query API returns in:

  • JSON: content-type: application/vnd.koordinates.setQuery+json. Results are encoded as GeoJSON-compatible Feature objects.
  • Xml: content-type: application/vnd.koordinates.vectorQuery+xml. A schema is available. Geometries are encoded as GML v3 geometry objects.
  • Json-gmaps: content-type: application/vnd.koordinates.vectorQuery-gmaps+json. For use with the Google Maps API, geometries are returned as arrays of geometry objects, with linestrings & polygons encoded for faster display & smaller response-size.

Formats can be specified via URL. For example: https://koordinates.com/services/query/v1/vector.json

They can also be specified using the HTTP Accept header with the appropriate content-type against the base URL. For example: application/vnd.koordinates.vectorQuery.1+json

By default, all responses use the newest format. While we try very hard to prevent backwards-incompatible breaks, please note that it may happen in future

If you're using the URL endpoint (eg. vector.json) you can pass a &v=1 parameter to specify version 1.0. The current version is 1.1.

Compression

Add a request header with Accept-Encoding: gzip to get compressed results. This dramatically reduces the size of the response and will speed up your API requests.

Get information from vector datasets

Authorizations:
SessionAuthenticationHeaderTokenAuthentication
Request Body schema: application/json
key
required
string

Your Koordinates API key

layer
required
string

The ID of the vector layer to get results from

x
required
number

Longitude of the point you want to query

y
required
number

Latitude of the point you want to query

max_results
integer [ 1 .. 100 ]
Default: 1

Maximum number of results to return

radius
integer [ 0 .. 100000 ]
Default: 1000

Distance in meters to query around the specified point.

geometry
boolean
Default: false

Whether to include the geometry for each feature result

with_field_names
boolean
Default: false

Whether to include an ordered list of field names. Availability: 1.1

callback
boolean

Only available for JSON formats. If supplied, will use the JSONP format with a callback of the given name

Request samples

Content type
application/json
{
  • "key": 1,
  • "layer": 743,
  • "x": -41.27831,
  • "y": 174.77694,
  • "max_results": 1,
  • "radius": 1000,
  • "geometry": false,
  • "with_field_names": false,
  • "callback": false
}