Metaserver API (v1)

Download OpenAPI specification:Download

Introduction

Metaserver provides CoMET services without creating a metadata record, resolves xlinks, and translates between different XML standards

ISO

For more information on the ISO Standard 19115-2, please visit this documentation link.

OpenAPI Specification

This API is documented in OpenAPI format and is displayed using ReDoc. In addition to standard OpenAPI syntax, ReDoc uses a few vendor extensions.

Authentication

Users must first establish a user session in order to use the API endpoints. Sessions are established by sending login credentials via an HTTP request to the login URL. The server will create a cookie that contains an API Key (JSESSIONID) that authorizes each request. The cookie must be sent with each request and is valid so long as the session stays alive.

Login Requirements:

  • Users must have a @noaa.gov email account with Metaserver.

HTTPCookie

Security Scheme Type: API Key
Cookie parameter name: JSESSIONID

Login

Users must first establish a user session to use the API endpoints. Sessions are established by sending login credentials via an HTTP request to the login URL. The server will create a cookie that contains an API Key (JSESSIONID) that authorizes each request. The cookie must be sent with each request and is valid so long as the session stays alive.

Login

Request Body schema: application/x-www-form-urlencoded
username
string
password
string

Responses

Request samples

# This script saves your apiKey (JSESSIONID) to a cookie file on disk. This file, cookie.txt, is sent in other examples in this documentation 

curl -X 'POST' \
'https://data.noaa.gov/cedit/login/wsLogin' \
-H 'accept: */*' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'username=your.username' -d 'password=yourPassword'  \
--cookie-jar cookies.txt

Record Services

Record Services currently supports validating ISO 19115-2 metadata, validating online resource links, checks to see if a resolved xlinks creates valid XML, and provides the Rubric V2 scores as a json object.

Validate

Resolves xlinks to xml components and validates resulting document against the ISO 19115-2 standard

Authorizations:
HTTPCookie
query Parameters
filename
required
string

Filename or name of record being sent

Request Body schema: application/xml

AcceptsISO 19915-2 XML.

gmi:MI_Metadata
object

Responses

Request samples

Content type
application/xml
Loading...

Response samples

Content type
application/json
Example
{
  • "service": "isovalidatecheck",
  • "date-time": "2022-09-27T13:48:31.452Z",
  • "record": "example.xml",
  • "error_count": "0"
}

Rubric V2

Returns Rubric V2 scores as json object

Authorizations:
HTTPCookie
query Parameters
filename
required
string

Filename or name of record being sent

Request Body schema: application/xml

Accepts XML in ISO 19115-2, resolves xlinks,

gmi:MI_Metadata
object

Responses

Request samples

Content type
application/xml
Loading...

Response samples

Content type
application/json
Example
{
  • "service": "transisotorubricv2",
  • "date-time": "2022-09-27T13:48:31.452Z",
  • "record": "example.xml",
  • "error_count": "0",
  • "totals_array": [
    ],
  • "categories_array": [
    ]
}

Simple Resolve

Resolves xlinks to xml components and returns a success if XML document is created. Doesn't return errors if xlink or resulting XML isn't valid ISO 19115-2

Authorizations:
HTTPCookie
Request Body schema: application/xml

Accepts XML in ISO 19115-2 and resolves xlinks to xml components. Only responds 200 for success or 400 for failure. See Transform to get a resolved document to save.

gmi:MI_Metadata
object

Responses

Request samples

Content type
application/xml
Loading...

Response samples

Content type
application/json
Example
{
  • "statusCode": "200",
  • "statusMessage": "success"
}

Link Check

Verify online resource links within the ISO tag CI_OnlineResource are valid URLs. This API can be slow depending on the number links to be checked and the link status.

Authorizations:
HTTPCookie
Request Body schema: application/xml

Accepts ISO 19115-2 XML

gmi:MI_Metadata
object

Responses

Request samples

Content type
application/xml
Loading...

Response samples

Content type
application/json
Example
{
  • "service": "olrlinkcheck",
  • "date-time": "2022-09-27T13:48:31.452Z",
  • "record": "example.xml",
  • "error_count": "0"
}

Transform

Upload an xml document by rawxml or url and transform it to a requested format

Authorizations:
HTTPCookie
Request Body schema: application/x-www-form-urlencoded
inputLocation
string
Enum: "rawxml" "url"

Input Options: rawxml, url
rawxml - Allows you to send xml in the form using the parameter rawxml.
url - Allows you to upload xml from a url using the parameter url.

recordAction
string
Enum: "resolve" "none" "isovalidatecheck" "olrlinkcheck" "nceilandingpage" "transisotorubricv2" "transisotorubric" "transncmltorubric" "transncmltoiso" "fgdctoiso"

resolve - Resolve URL references to components. Input: 19139 schema valid XML file. Response: ISO 19115-2 XML
none - Check for well-formed XML. Input: 19139 schema valid XML file. Response: Plain Text
isovalidatecheck - Validate metadata with 19139 Schema. Input: 19139 XML file. Response: HTML
olrlinkcheck - Verify online resource links within the ISO tag CI_OnlineResource are valid URLs. Response: Plain Text
nceilandingpage - Generate the NCEI Landing page view based on a valid ISO 19115-2 XML file. Response: HTML
transisotorubricv2 - Generate v2 IMPROVED completeness assessment report. Input: 19139 schema valid XML file. Response: HTML
transisotorubric - Generate v1 completeness assessment report. Input: 19139 schema valid XML file. Response: HTML
transncmltorubric - Generate v1 completeness assessment report. Input: NetCDF XML. Response: HTML
transncmltoiso - Translate from NCML to ISO 19115-2. Input: ACDD compliant NetCDF XML. Response: ISO 19115-2 XML
fgdctoiso - Translate from FGDC to ISO 19115-2. Input: FGDC compliant XML. Response: ISO 19115-2 XML

filename
string

Name if the file uploaded. Ignored if url is used for inputLocation

url
string

URL to retrieve XML. Ignored if rawxml is used for inputLocation

rawxml
string

The XML uploaded by file. Ignored if url is used for inputLocation

Responses

Request samples

#!/bin/bash
# Transform a file on your computer using Record Services

export METASERVER_URL="https://data.noaa.gov/recordServices/upload"

# Change this variable for different transforms, options are:
# resolve, none, isovalidatecheck, olrlinkcheck, nceilandingpage,
# transisotorubricv2, transisotorubric, transncmltorubric, transncmltoiso, and fgdctoiso
recordAction="resolve"

echo -n "Enter the filename to transform: "
read filename

curl --cookie cookies.txt \
  -L --max-redirs 1 \
  -k \
  "$METASERVER_URL" \
  -F recordAction="$recordAction" \
  -F inputLocation="file" \
  -F filename=@"$filename"