Site Admin APIs

  1. Home
  2. Site Admin APIs
  3. Metadata API

Metadata API

The Metadata API provides an interface for adding, inspecting, and downloading XML metadata documents against a range of objects.

The metadata API is a sub-API of data object details pages. This means that the URL will vary according to each data object. Specifically:

  • Sources at /sources/{source-id}/metadata/
  • Layers at /layers/{layer-id}/versions/{version-id}/metadata/
  • Tables at /tables/{table-id}/versions/{version-id}/metadata/
  • Documents at /documents/{document-id}/versions/{version-id}/metadata/
  • Sets at /sets/{set-id}/metadata/

Supported metadata standards

The following XML metadata standards are supported:

  • ISO 19115/19139
  • FGDC CSDGM
  • Dublin Core

Metadata detail

GET /
Get XML metadata

Returns the XML metadata for this source, in the original format supplied by the source creator. 

Response 200

Headers

Content-Type: text/xml

Body

<dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
    <title>Auckland Harbour Imagery (4m)</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>
POST /
Set or replace metadata

If the source already has XML metadata, it will be overwritten. This will accept XML metadata in any of the three supported formats. The format will be detected from the XML content. 

Request

Headers

Content-Type: text/xml

Body

<dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
    <title>Auckland Harbour Imagery (4m)</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>

Response 201

PUT /
Edit metadata

This is an advanced API to facilitate XML metadata editing via element changes, and is not documented here.

Metadata types

GET /{type}/
Get XML metadata by type

Returns the XML metadata for this source, converted to a different format. The converted metadata may not contain all the same information as the native format.

Parameters

type: string (required)

choices: iso fgdc dc

Response 200

Headers

Content-Type: text/xml

Body

<dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
    <title>Auckland Harbour Imagery (4m)</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>

Metadata element definition

GET /{type}/elementDefinition/
Get metadata element definition

This is an advanced API to facilitate XML metadata editing via element changes, and is not documented here. 

Metadata editing context

GET /{type}/context/
Get metadata editing context

This is an advanced API to facilitate XML metadata editing via element changes, and is not documented here. (Note that type is optional).