You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 66 Next »

Chapter 1: Before You Begin

The NASA-developed Earth Observing System (EOS) Common Metadata Repository (CMR) is a spatial and temporal metadata registry that enables the science community to more easily use and exchange NASA's data and services. The CMR's main objective is to enable broader use of NASA's EOS data. It allows users to more efficiently search and access data and services and increases the potential for interoperability with new tools and services. The value of these resources increases as the potential to exchange and inter-operate increases. The CMR has been working with other organizations to provide their Earth science metadata alongside NASA's for users to search and access. The CMR stores metadata from a variety of science disciplines and domains, including Climate Variability and Change, Carbon Cycle and Ecosystems, Earth Surface and Interior, Atmospheric Composition, Weather, and Water and Energy Cycle. 

NASA's Earth science data has already proven itself to be extremely useful in understanding the planet Earth as an integrated system. To help science communities that need data from multiple organizations and multiple disciplines, the CMR provides a uniform view of NASA's data. It allows users to more efficiently search and access data and services and increases the potential for interoperability with new tools and services. For examples of how NASA's Earth science data is helping scientists understand the complexities of our Earth, visit Sensing our Planet and Other Featured Research Articles at https://earthdata.nasa.gov/

The CMR was designed to increase access to NASA Earth science data and services by providing a system with a machine-to-machine interface, that is, an Application Programming Interface (API). This API facilitates the discovery, online access, and delivery for a Data Partner's data holdings. The CMR Data Partners retain complete control over what metadata are represented in the CMR by means of inserting new metadata, modifying existing metadata, removing old metadata, and controlling access to their metadata. The CMR Client Partners develop client applications that access the CMR API and take advantage of the services made available. These clients, such as Earthdata Search (https://search.earthdata.nasa.gov), CMR open search (https://api.echo.nasa.gov/opensearch), Reverb (https:reverb.echo.nasa.gov), etc. allow end users to discover data which has been registered in the CMR's holdings and can be custom made to meet the needs of a general user audience, or a specific science application.

The CMR Concept and Design

NASA's Earth Science Data and Information System (ESDIS) has built the CMR based on Extensible Markup Language (XML) and Web Service technologies. The CMR interfaces with clients and users through its series of Application Program Interfaces (APIs). The CMR is an open system with published APIs available to the CMR Development and User community. 

CMR System Concept

Internally, the CMR specifies APIs and provides middleware components, including data and service search and access functions, in a layered architecture. The figure above depicts the CMR system context in relation to its public APIs. 

The CMR allows Client Partners to use the API to create their own tailored software systems for their purposes. The API allows clients to search and retrieve metadata including but not limited to collections, granules, and services. All CMR metadata is stored as received by the data partners and can be retrieved by the native specification or another specification as requested by the client.  


Key features of the CMR architecture are:

  • Ease of Partner Participation – Designed to be low-cost and minimally intrusive, the CMR offers a set of standard ways for partners to interface with the system through provided web UIs and a metadata exchange approach that accommodates existing partners and technology.
  • Open System / Published APIs – To accommodate independent CMR clients, CMR uses an open system approach and publishes domain APIs. These APIs are independent of the underlying transport protocols used. CMR communicates using WS-I Basic Profile v1.0 compliant web services for legacy services and RESTful web services for CMR ingest, search, and metadata management.
  • Evolutionary Development – The CMR system is being developed incrementally to allow for insight and feedback during the development cycle. Industry trends are followed and the use of commercial, off-the-shelf (COTS) products is optimized.

Security

The CMR system requires Secure Sockets Layer (SSL)-based communication from Client Applications to the CMR API, but does not require, secure communication from CMR to a Client Partner's service. Internally, the CMR system is protected through a layer of software and hardware control mechanisms to preserve the integrity of CMR's holdings. When configuring data access fulfillment, Data Partners are strongly encouraged to utilize SSL communications.

CMR Capability And Functionality

CMR provides an infrastructure that allows various communities to share tools, services, and metadata. It supports many data access paradigms such as navigation and discovery.  It facilitates data access through appropriate Data Partners, decentralizes end user functionality, and supports interoperability of distributed functions. 
Although this Guide focuses on the needs of Client Partners, support is provided for the following different, nonexclusive types of Partners:

  • Data Partners – Organizations that supply metadata representing their data holdings to the CMR system
  • Client Partners – Organizations that participate by developing software applications to access the Earth science metadata in the CMR system 
  • Service Partners – Organizations that participate by advertising their Earth science-related services to the user community via the CMR, which maintains service descriptions in a Service Catalog (either special services, or services that are available as an option on a selected set of granules/collections) and support the user in accessing those services.

The CMR addresses science user needs through a set of well-defined and open interfaces upon which the user community can build its own client applications. In this way, the CMR supports extendable, flexible user interfaces, allowing industry and the science community to drive the progress of available earth science applications. For more complete information about client applications, refer to the companion piece to this Guide, the CMR Data Partner's Guide.
The CMR approach allows users to build their own user interfaces to the CMR, rather than being limited to the data search and access system provided by NASA. For Data Partners, the system offloads the burden of providing the system resources required for searching and gives users the flexibility to support community-specific services and functionality. The CMR's interoperability features allow all participants to benefit from the distributed development of functions, again reducing dependence on NASA resources.

 

CMR as a Spatially Enabled Metadata Search and Retrieval System

The CMR allows Data Partners to define the spatial extent of a granule or a collection with different spatial constructs (for example: point and polygon). These spatial extents may be in either the Geodetic or Cartesian coordinate systems. Orbital data may also be provided to describe a collection or granules spatial extents. A Client Partner can then construct a search using a point, a line, or a polygon (or multiple polygon) spatial type, and the CMR responds with data whose spatial region intersects the described region. 
The CMR provides services for interacting with its catalog of metadata. Queries can be performed in a number of ways; result contents can be specified, and the resulting data sets can be incrementally accessed so that large return sets can be handled gracefully. The system also supports constructing, submitting, and tracking access requests for the data that the metadata represents. The CMR supports both an embedding of a Uniform Resource Locator (URL) within the metadata for accessing the data (which the client simply accesses via Hypertext Transfer Protocol [HTTP]) or File Transfer Protocol (FTP), and a more complicated data access process in which other options are accommodated.

CMR Benefits to Client Partners

The CMR's open system provides earth science data and services to a large, diverse pool of users, enabling scientific community interaction and collaboration. The Client Partners are benefitted in the following ways:

 

  • Ease of Participation - The primary goal of the CMR is to enable organizations to participate in making their resources and capabilities available to the Earth Science community. To facilitate participation by these organizations, the CMR has:
    • Minimized the number of requirements that a partner must meet to participate.
    • Involved partners in the system's development cycle and requirements definition.
    • Selected metadata insert and update mechanisms based on current standard industry practice (for example, XML) that most databases can generate automatically.
    • Provided mapping capabilities to convert from one XML representation into another.
  • Cost to Field - While aggressive in the capabilities it is targeted to support, the CMR minimizes the Cost to Field by continually evaluating performance and functionality against costs, for example, licensing of Commercial Off-the-Shelf (COTS) applications, amount of custom code required, hardware platform requirements, and complexity of networking and installation.
  • Cost to Operate - Once fielded, the CMR seeks to minimize the cost to operate the system by making it easier to use, thereby minimizing the load on operations staff.

Client Partner Skills

Since the CMR uses platform-independent web service definitions for its API, there are no requirements for a client programming language. All examples in this document use curl; however, the code samples provided could be translated to any web service capable language. 
As a CMR Client Partner, you need to be familiar with basic software development and Service Oriented Architecture (SOA) concepts such as:

  • XML and XML Schema (XSD)
  • Client/Server-based programming (client stubs, remote endpoints, etc.)
  • RESTful client and service communication programming
  • Service-based Application Programmer's Interface (API)

Client Partner Tasks

As a Client Partner who is beginning to integrate with CMR, you should expect to perform the steps below which are detailed in later sections: 

  • Creating and managing user accounts and user access
  • Searching for data
  • Retrieving data
  • Fulfilling orders is a service provided by ECHO. - Place this in the Retrieving section.\

CMR System Environments

There are three CMR Systems that you, as a Client Partner, have access to. A short description of each system is given below. For additional information, refer to the links below;

  • CMR Operations - The CMR Operations environment is the CMR production system - monitored 24/7 - which serves the needs of the Earth Science community. The Data Holdings within this system include those which CMR's Data Partners have made available for use by the Earth Science community.  This environment is updated with enhancements and fixes on a monthly cycle with virtually no down time.
  • CMR UAT (User Acceptance Test) - The UAT environment provides a stable test system which serves the needs of the CMR Data, Client, and Service partners. The Data Holdings within this system include those which CMR's Data Partners have made available for their own testing purposes. This environment is updated with the same enhancements and fixes that are going to operations, but are installed two weeks prior to operations delivery. CMR Partners are encouraged to verify the capabilities when a new release is installed.
  • CMR SIT (System Integration Test) The SIT system has been established in order to facilitate an exchange of ideas and provide early insight into the upcoming capabilities.  Not all capabilities will become operational. There is often very little metadata available in this mode, but it is fully functional. The next operational version is released into this system approximately 1 month before its schedule Operational release date.

Chapter 2: Getting Started

This chapter will discuss

  • creating and managing user accounts
  • CMR session management - creating, using, and deleting tokens to provide authorization

If searching for and retrieving publicly available data is the only desired operation, this section can be skipped and the reader can go straight to Chapter 3.

User Accounts

User accounts are used to get access to restricted data, manage privileges, or to interact with other services and tools provided by the CMR or ECHO. User accounts for the CMR system are created and manage by the EARTHDATA Login (URS) system. If you need an account and don't already have one, please click on EARTHDATA Login to create one. Once created you can always go back to EARTHDATA Login to manage it. If you are part of a Data Provider group or other team the team administrator can set up permissions for you to access their restricted data. If you need special privileges you can always contact the CMR operational team at support@earthdata.nasa.gov and they can help you. 

Creating and Managing CMR Sessions

The CMR uses tokens in request messages - the http call to CMR - to validate per request who the requester is and what privileges they have. For most searches, a token is not needed because the metadata records are open to everyone. When certain metadata records are restricted a token is needed so that privileged users can see and access those records.  A Session is nothing more than a series of requests that use the same token meaning that you can use the same token for many requests before you delete it. All tokens expire at the end of a time period; At the time of this writing the duration is 30 days. Because the token is used to track your session, it must be protected by client applications with the same level of security that you use for your login name and password.

To conduct a session the normal steps are:

  • Create a token
  • Do one or more of the following in any order:
    • Search for records
    • Retrieve records
  • Delete the token 

Create a Token

Information on creating EDL tokens can be found at https://urs.earthdata.nasa.gov/documentation/for_users/user_token

 

Now that the client partner has created a token, they can search and retrieve records, and conduct other functionality through the CMR or ECHO APIs. This functionality is covered in later chapters of this document. Once finished interacting with the CMR the token can be deleted.

Delete the Token

Information on deleting EDL tokens can be found at https://urs.earthdata.nasa.gov/documentation/for_users/user_token


 

Chapter 3: Searching for metadata

Client partners can search the CMR for metadata.  Currently clients can search for collection and granule metadata.  In the future clients will also be able to search for metadata describing services, visualizations, parameters (variables), and documents.

CMR Environment URLs

The CMR system has three environments: The Systems Integration Test environment is where the CMR development team tests new functionality. This is the environment that first gets the newest upgrades, but it is the least stable. Once the CMR software has been tested it gets deployed to the User Acceptance Test environment. The environment here is quite stable and it is tested as a system for a couple of weeks before the software is deployed to the operational environment. Client Partners can test their software in either the SIT or UAT environment depending the level of integration and testing. The operational environment is the live system available to users around the world.  All of the examples provided in the rest of the document are using the Systems Integration Test environment.  To run the commands in the other environments just replace the SIT URL with either the UAT or OPS URL to use the API in the respective environments.

CMR Environment

Base API URL

Operational (OPS)

https://cmr.earthdata.nasa.gov

User Acceptance Test (UAT)

https://cmr.uat.earthdata.nasa.gov

Systems Integration Test (SIT)

https://cmr.sit.earthdata.nasa.gov

CMR Environments

Headers

Headers are a part of HTTP requests and for the CMR they provide information such as the content of the message (Content-Type), tokens to allow increased privileges (Echo-Token), the format of the data that gets returned (accept), etc. Content-Type is a standard HTTP header that specifies the content type of the body of the request for POST method messages. Search and retrieval requests support the following Content-Types. If the Content-Type is not specified, XML is assumed.

Body formatContent-Type
XMLapplication/xml

JSON

application/json

Content-Type headers

The Echo-Token allows the CMR to know who is making a request. The Token is in the format of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.  A token must first be generated as described in the previous section. Once the requester has the token, the token can be placed into the http header for the necessary API calls.

If the caller wishes to control in what format and or specification the data gets returned they can use the Accept header.  The following table lists the valid values.  If this header or an alternative method is not used, the returned outcome will be a reference list of results in XML format.

Type Received
Accept HeaderValue
Comments
xml

application/xml

returns a reference list of results using the XML format
jsonapplication/jsonreturns a subset of metadata data list of results using the JSON format
echo10application/echo10+xmlreturns a full metadata record list of results in the echo 10 specification using the XML format
isoapplication/iso19115+xmlreturns a full metadata record list of results in the ISO 19115-2 (MENDS) specification using the XML format
iso19115application/iso19115+xmlreturns a full metadata record list of results in the ISO 19115-2 (MENDS) specification using the XML format
difapplication/dif+xmlsupported for collections only and returns a full metadata record list of results in the DIF 9 specification using the XML format
dif10application/dif10+xmlsupported for collections only and returns a full metadata record list of results in the DIF 10 specification using the XML format
csvtext/csvsupported for granules only and returns a subset of metadata list of results in a comma separated value format
atomapplication/atom+xmlreturns a subset of metadata list of results in the ATOM specification using the XML format
opendataapplication/opendata+jsonsupported for collections only and returns a full metadata record list of results in the open data specification using the JSON format
kmlapplication/vnd.google-earth.kml+xmlreturns a subset of spatial metadata list of results using the KML specification in the XML format
nativeapplication/metadata+xmlreturns a full metadata record list of results in their individual native specification using the XML format

Accept Headers

For more information about the types please see the CMR API documentation.

Client-Id is another header that allows the client to specify a name.  This helps the CMR operations team monitor query performance per client and it can also make it easier for them to identify your requests if you contact them for assistance.

Following are some examples for using the headers. The purple part of the example will be explained in this section, the rest will be described later:

The following curl command issues a search request with the search parameters contained in a file called searchterms in the current directory. The Content-Type - the specification and format of the searchterms file - is using the json format to specify the search parameters. The accept header states that we want the results as a reference list using the XML format. The Echo-Token header allows the CMR to know who is making the request for authorization purposes. The Client-Id header allows the operations team to monitor performance and allows them to quickly find your requests should you need help.

curl -v -XPOST -H "Content-Type: application/json" -H "Echo-Token: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Accept: application/xml" -H "Client-Id: Test_Team" -d @searchterms -i https://cmr.sit.earthdata.nasa.gov/search/collections

 

In the next example a user is issuing a search request using publicly available data and is returned a full metadata record list of results. Notice that only the Accept header is needed.

curl -v -H "Accept: application/metadata+xml" -i https://cmr.sit.earthdata.nasa.gov/search/collections

In the next example a user is issuing a search request using publicly available data and the default result reference list.  Notice that no headers are needed.

curl -v -i https://cmr.sit.earthdata.nasa.gov/search/collections

As an alternate to using the Accept header are extensions where the client can use the Type Received name in the query to get the same results. Instead of using "Accept: application/opendata+json", "opendata" can be used at the end of the main query before parameters are specified. 

curl -v -i "https://cmr.sit.earthdata.nasa.gov/search/collections.opendata"

Other examples use the DIF 10 specification and the ISO specification respectively.

curl -v -i "https://cmr.sit.earthdata.nasa.gov/search/collections.dif10"

curl -v -i "https://cmr.sit.earthdata.nasa.gov/search/collections.iso"

To change what is wanted in the request just replace the header as needed per the tables above.

Results

There are a several of types of results that can be returned.  For each of these types different formats are supported.:

  1. A reference list of results
    1. XML
  2. A list of results with partial metadata records being provided
    1. XML
    2. JSON
    3. ATOM
    4. CSV - supported for granules only
    5. KLM
  3. A list of results with full metadata records being provided
    1. XML
    2. opendata

The following is an example of a reference list of results

<results>

    <hits>2215</hits>

    <took>16</took>

    <references>

        <reference>

            <name>100m Digital Elevation Model Data V001</name>

            <id>C1000000803-DEV08</id>

            <location>https://cmr.sit.earthdata.nasa.gov:443/search/concepts/C1000000803-DEV08>

            <revision-id>8</revision-id>

        </reference>

        <reference>

            <name>100m Digital Elevation Model Data V001</name>

            <id>C1000000719-EDF_OPS</id>

            <location>https://cmr.sit.earthdata.nasa.gov:443/search/concepts/C1000000719-EDF_OPS>

            <revision-id>8</revision-id>

        </reference>

        ...

    </references>

</results>

The results specify

  1. how many metadata records were found by the "hits" tag
  2. how long the query took in milliseconds
  3. a list of metadata record results specified by the "reference" tag

With in each reference tag a limited information about the metadata is provided.

  1. The metadata name which corresponds to the UMM Entry Title
  2. The CMR profile or concept ID -  a CMR generated unique ID.  The ID is encoded by a letter of the profile or concept (C for collection, G for granule, S for service), followed by a CMR generated number, followed by a "-" and then followed by the ID of the metadata provider.
  3. The exact CMR location to download the metadata
  4. The latest revision number of the metadata record.

The following is an example of a full metadata record list of results in the ECHO 10 specification using the XML format.

<results>

    <hits>2215</hits>

    <took>53</took>

    <result concept-id="C1000000803-DEV08"

        format="application/echo10+xml" revision-id="8">

        <Collection>

            <ShortName>DEM_100M</ShortName>

            <VersionId>1</VersionId>

            <InsertTime>2002-04-27T15:27:55.293Z</InsertTime>

            <LastUpdate>2013-10-04T08:49:26.783Z</LastUpdate>

            <LongName>100m Digital Elevation Model Data</LongName>

...

</Collection>

    </result>

    <result concept-id="C1000000719-EDF_OPS"

        format="application/echo10+xml" revision-id="8">

        <Collection>

            <ShortName>DEM_100M</ShortName>

...
</Collection>
...

  </result>

</results>

The results specify

  1. how many metadata records were found by the "hits" tag
  2. how long the query took in milliseconds
  3. a list of metadata record results specified by the "result" tag

Within each result tag three attributes are shown about the metadata record followed by the full metadata record. The attributes display the CMR concept id (profile ID), the specification and format of the metadata, and the revision number of the shown metadata record.  For detailed information about the result specifications and formats available with examples please see the CMR API documentation.

Searching

There are several ways to search the CMR system all using the RESTful principles:

  1. Using the API calls and parameters with the GET or POST methods
  2. Using a JSON query language with a POST method
  3. Using the Alternative Query Language (AQL)

API calls and parameters GET method

The most popular and preferred way is to use the API calls and parameters with the GET or POST methods. For detailed documentation the API documentation is located at https://cmr.earthdata.nasa.gov/search/site/search_api_docs.html.

The CMR uses jetty as its application server and it is currently set to take roughly 500k characters in the URL. Clients using the Search API with query parameters should be careful not to exceed this limit or they will get an HTTP response of 413 FULL HEAD. If a client expects that the query url could be extra long so that it exceeds 500k characters, they should use the POST method for searching instead of the GET method. First we will describe search using the GET method.

The basic search command is shown in the following example 

curl -v -i "https://cmr.earthdata.nasa.gov/search/collections"

The query returns the first 10 publicly available collection results in a reference list using the XML format.  As described in the header section to see restricted data, if you have the privileges you will need to use a token.

There are search parameters that can be applied to provide more functionality.  They are listed below

  • page_size - The number of results per page - the default is 10. 0 and 2000 are the minimum and maximum values respectively.  For example: page_size=100 shows 100 result records per page if that many results exist.
  • page_num - The page number to return. For example: page_num=1 is the first page of results;  page_num=2 is the second page of results; page_num=10 is the 10th page of results.
  • sort_key - Indicates one or more elements to sort on. For example: sort_key[]=platform  (the brackets "[" and "]" may need to be escaped by using the \ character)
  • pretty - Returns formatted - readable - results if set to true.  For example pretty=true.  For all the returned examples in this document this flag is used.
  • token - Specifies the client token. This is an alternative to using the Echo-Token header.
  • echo-compatible - This is used by systems requiring ECHO results. To get the best use out of CMR Client Partners shouldn't use this parameter.

These search parameters are for collection requests only.

  • include_has_granules - Includes a has-granules tag or attribute in the response so the client knows if the collection encompasses any granules. E.g. include_has_granules=true
  • include_granule_counts - Includes a granule-counts tag or attribute in the response with the number of granules represented by the collection. E.g. include_granule_counts=true
  • include_facets - Includes a list of facets and their counts at the end of the results. This is mainly used for collection search displays. E.g. include_facets=true
  • include_facets with hierarchical_facets - Includes a list of facets preserving the hierarchical order. This is mainly used for collection search displays. E.g include_facets=true&hierarchical_facets=true

 In next example box we will see a set of examples conducting a basic search with using the search parameters just described. The first example shows a client wanting to see 50 metadata references per page. The second example shows 50 metadata references per page using the formatted print.  The third example shows page 2 of 20 results per page showing full records in the echo 10 specification using formatted print. The fourth example issues a request including token and client id headers and does a basic search sorting the results using the platform element.  The request returns page 2 results of 20 results per page showing full records in the ISO 19115 specification using the XML format in a formatted fashion. As one can see the ? character separates the URL from the search parameters and the search parameters are separated by the & character. The parameters can be in any order.

curl -v -i "https://cmr.earthdata.nasa.gov/search/collections?page_size=50"

curl -v -i "https://cmr.earthdata.nasa.gov/search/collections?page_size=50&pretty=true"

curl -v -i "https://cmr.earthdata.nasa.gov/search/collections.echo10?page_num=2&page_size=20&pretty=true"

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/collections.iso?sort_key\[\]=platform&page_num=2&page_size=20&pretty=true"  

The previous examples all demonstrated searches for collections. The same search parameters apply to granules if it isn't stated that a parameter applies only to collections. To conduct a granule search, just replace collections with granules in the URL.  Following are the same four search requests just listed above but for granules instead of collections.

curl -v -i "https://cmr.earthdata.nasa.gov/search/granules?page_size=50"

curl -v -i "https://cmr.earthdata.nasa.gov/search/granules?page_size=50&pretty=true"

curl -v -i "https://cmr.earthdata.nasa.gov/search/granules.echo10?page_num=2&page_size=20&pretty=true"

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/granules.iso?sort_key\[\]=platform&page_num=2&page_size=20&pretty=true"  

Now to refine our searches we can use another set of search parameters documented in the table below. These parameters support collection searches and most of these parameters have the brackets next to them and may need to be escaped (\[\]) depending on the language used or how the query is being sent.  All of CMR time search parameters (temporal, updated_since, revision_date, and equator_crossing_date) formats are specified as yyyy-MM-ddTHH:mm:ss.SSSZ format. Where yyyy is year; MM is month; dd is day; T is the date time separator character; HH is the hour; mm is the minute; ss is the second; SSS is the milliseconds (the .SSS can be omitted); and Z specifies Zulu time.  January 2 2000 at 5 seconds and 4 minutes past 3 O'clock in the morning Zulu time is represented as 2000-01-02T03:04:05Z.

Search ParametersExampleNotesSupports Pattern OptionSupports Case Insensitivity OptionSupports AND Option (ALL values have to be present within an element)Supports OR Option (ANY value has to be present within an element)
concept_idconcept_id\[\]=C123456-LPDAAC_ECS NONONONO
echo_collection_id

echo_collection_id\[\]=C1000000001-CMR_PROV2

uses concept_idNONONONO
entry_titleentry_title\[\]=this is a title YESYESNONO
dataset_iddataset_id\[\]=this is a titleuses entry_titleN/AN/ANONO
entry_identry_id\[\]=SHORT_V5 NONONONO
dif_entry_iddif_entry_id\[\]=SHORT_V5matches either entry_id or associated difsNONONONO
archive_centerarchive_center\[\]=SEDAC YESYESNONO
temporal

temporal\[\]=2000-01-01T10:00:00Z,2010-03-10T12:00:00Z,30,60

or

temporal\[\]=2000-01-01T10:00:00Z/P10Y2M10DT2H,30,60

format is: begin datetime, end datetime, period, duration

or: begin datetime/ISO 8601 time interval

One can leave out the begin time or end time or both the period and duration

ranges are inclusive unless otherwise specified

N/A N/ANONO
projectproject\[\]=ESI YES YESYESNO
campaigncampaign\[\]=ESIuses projectYES YESYESNO
updated_sinceupdated_since=2000-01-01T01:00:00ZThe time is inclusive.NON/ANONO
revision_date

revision_date\[\]=2000-01-01T01:00:00Z,2010-01-01T12:34:56Z

revision_date\[\]=2000-01-01T01:00:00Z,

The beginning or ending date time can be left off, but comma must remain. Inclusive boundary search

NON/A YESNO
processing_level_idprocessing_level_id\[\]=1B YES YESNONO
platformplatform\[\]=AQUA platform short nameYES YESYESNO
instrumentinstrument\[\]=CERES instrument short nameYES YESYESNO
sensorsensor\[\]=CCD sensor short nameYES YESYESNO
spatial_keywordspatial_keyword\[\]=VA YESYESYESNO
science_keywords

science_keywords\[0\]\[category\]=EARTH SCIENCE&science_keywords\[0\]\[topic\]=BIOLOGICAL CLASSIFICATION&science_keywords\[0\]\[term\]=ANIMALS/VERTEBRATES&science_keywords\[0\]\[variable-level-1\]=MAMMALS&science_keywords\[0\]\[variable-level-2\]=CARNIVORES&science_keywords\[0\]\[variable-level-3\]=BEARS

There is a hierarchy for science keywords.

These can be ANDed together which is the default or ORed.

NONOYESYES
two_d_coordinate_system_nametwo_d_coordinate_system_name\[\]=Alpha YESNONONO
two_d_coordinate_system[name]two_d_coordinate_system\[name\]=Alphaalias of two_d_coordinate_system_name but does not support patternNONONONO
collection_data_typecollection_data_type\[\]=NEAR_REAL_TIME

valid values for near real time:

"NEAR_REAL_TIME": "near_real_time", "nrt", "NRT", "near real time", "near-real time", "near-real-time", "near real-time"

ALSO uses OTHER, SCIENCE QUALITY

NOYESNONO
providerprovider=ASF YESYESYESNO
short_nameshort_name=MINIMAL YESYESYESNO
versionversion=1used together with short_nameYESYESYESNO
polygonpolygon=10,10,30,10,30,20,10,20,10,10Polygon points are provided in counter-clockwise order. The last point should match the first point to close the polygon. The values are listed comma separated in longitude latitude order, i.e. lon1, lat1, lon2, lat2, lon3, lat3, and so on.N/AN/ANONO
bounding_boxbounding_box=-10,-5,10,5Bounding boxes define an area on the earth aligned with longitude and latitude. The Bounding box parameters must be 4 comma-separated numbers: lower left longitude, lower left latitude, upper right longitude, upper right latitude.N/AN/ANONO
pointpoint=100,20Search using a point involves using a pair of values representing the point coordinates as parameters. The first value is the longitude and second value is the latitude.N/AN/ANONO
lineline=-0.37,-14.07,4.75,1.25,25.13,-15.51Lines are provided as a list of comma separated values representing coordinates of points along the line. The coordinates are listed in the format lon1, lat1, lon2, lat2, lon3, lat3, and so on.N/AN/ANONO
keyword
keyword=alpha
By default keyword searches are case insensitive and support wild cards ? and *. The following elements are searched by a keyword search Concept ID, Provider ID, Entry Title, data type, short name, long name, abstract, version, version description, processing level id, science keywords, archive centers, additional attribute (names, data types, values, and descriptions), spatial keywords, temporal keywords, associated dis, project short and long names, platform short and long names, instrument short names, long names, and techniques, sensor short names, long names, and techniques, characteristic names and descriptions, and two d coordinate system namesNONONONO
online_onlyonline_only=truevalid values: true, falseNONONONO
downloadabledownloadable=truevalid values: true, falseNONONONO
browse_onlybrowse_only=falsevalid values: true, falseNONONONO
browsablebrowsable=truevalid values: true, falseNONONONO

Collection Search Parameters

Documented in the table below are granule supported search parameters.

Search ParametersExampleNotesSupports Pattern OptionSupports Case Insensitivity OptionSupports AND Option (ALL values have to be present within an element)Supports OR Option (ANY value has to be present within an element)
granule_urgranule_ur\[\]=SC:AST_L1B.003:2082836137 NONONONO
producer_granule_idproducer_granule_id\[\]=AST_L1B_00304092000162008_20110111183559_9769.hdf NONONONO
readable_granule_namereadable_granule_name\[\]=SC:AST_L1B.003:2082836137matches either granule ur or producer granule idNONONONO
online_onlyonline_only=truevalid values: true, falseNONONONO
downloadabledownloadable=truevalid values: true, falseNONONONO
attribute

attribute\[\]=UpperLeftQuadCloudCoverage

attribute\[\]=float,UpperLeftQuadCloudCoverage,25.5,30

attribute\[\]=float,UpperLeftQuadCloudCoverage,25.5,

attribute\[\]=float,UpperLeftQuadCloudCoverage,,30

attribute\[\]=int,UpperLeftQuadCloudCoverage,4

attribute\[\]=float,UpperLeftQuadCloudCoverage,25.5,30&options\[attribute\]\[or\]=true

attribute\[\]=float,UpperLeftQuadCloudCoverage,25.5,30&options\[attribute\]\[exclude_boundry\]=true

attribute\[\]=float,UpperLeftQuadCloudCoverage,25.5,30&options\[attribute\]\[exclude_collection\]=true

full syntax:name - attribute name only

full syntax: value type, attribute name, min value, max value - range search, can leave off beginning or ending of range, but comma is still needed. Ranges are inclusive. If this is not desired set to true the exclude_boundry option.

full syntax:value type, attribute name, value - single value attribute.

These searches include the granule collection - if this is not desired set to true the option exclude_collection

NONOYESYES
polygonpolygon=10,10,30,10,30,20,10,20,10,10Polygon points are provided in counter-clockwise order. The last point should match the first point to close the polygon. The values are listed comma separated in longitude latitude order, i.e. lon1, lat1, lon2, lat2, lon3, lat3, and so on.N/AN/ANONO
bounding_boxbounding_box=-10,-5,10,5Bounding boxes define an area on the earth aligned with longitude and latitude. The Bounding box parameters must be 4 comma-separated numbers: lower left longitude, lower left latitude, upper right longitude, upper right latitude.N/AN/ANONO
pointpoint=100,20Search using a point involves using a pair of values representing the point coordinates as parameters. The first value is the longitude and second value is the latitude.N/AN/ANONO
lineline=-0.37,-14.07,4.75,1.25,25.13,-15.51Lines are provided as a list of comma separated values representing coordinates of points along the line. The coordinates are listed in the format lon1, lat1, lon2, lat2, lon3, lat3, and so on.N/AN/ANONO
orbit_number

orbit_number=10

orbit_number=0.5,1.5

value or rangeNONONONO
equator_crossing_longitude

equator_crossing_longitude=90

equator_crossing_longitude=170,-170

value or rangeNONONONO
equator_crossing_dateequator_crossing_date=2000-01-01T10:00:00Z,2010-03-10T12:00:00Zdate range searches can be expressed using ISO 8601NONONONO
updated_sinceupdated_since=2015-01-01T13:12:11Z NON/ANONO
revision_date

revision_date\[\]=2015-03-04T16:15:14Z,2015-04-04T17:18:19Z

revision_date\[\]=2015-03-04T16:15:14Z,

The beginning or ending date time can be left off, but comma must remain. Inclusive boundary searchNON/AYESNO
cloud_covercloud_cover=-70.0,120.0The beginning or ending range can be left off, but comma must remain. Inclusive boundary searchNON/ANONO
platformplatform\[\]=AQUA platform short nameYES YESYESNO
instrumentinstrument\[\]=CERES instrument short nameYES YESYESNO
sensorsensor\[\]=CCD sensor short nameYES YESYESNO
projectproject\[\]=ESI YES YESYESNO
campaigncampaign\[\]=ESIuses projectYES YESYESNO
concept_id

concept_id\[\]=G123456-LPDAAC_ECS

concept_id\[\]=C123456-LPDAAC_ECS

This finds either the granule or the collection parent record - the difference is in the ID (C vs G)NONONONO
echo_granule_id

echo_granule_id\[\]=G1000000001-CMR_PROV2

uses concept_idNONONONO
collection_concept_idcollection_concept_id\[\]=C123456-LPDAAC_ECS NONONONO
echo_collection_idecho_collection_id\[\]=C123456-LPDAAC_ECS NONONONO
day_night_flagday_night_flag=dayvalid values are day, night, unspecifiedYESYESNONO
day_nightday_night=unspecifiedvalid values are day, night, unspecified - uses the day-night-flag element.YESYESNONO
two_d_coordinate_systemtwo_d_coordinate_system\[\]=wrs-1:5,10:8-10,0-10:8,12see API docs for descriptionNONONONO
gridgrid\[\]=wrs-1:5,10:8-10,0-10:8,12uses two_d_coordinate_system elementNONONONO
providerprovider=ASF YESYESYESNO
short_nameshort_name=MINIMAL YESYESYESNO
versionversion=1used together with short_nameYESYESYESNO
entry_titleentry_title\[\]=this is a title YESYESNONO
temporal

temporal\[\]=2000-01-01T10:00:00Z,2010-03-10T12:00:00Z,30,60

or

temporal\[\]=2000-01-01T10:00:00Z/P10Y2M10DT2H,30,60

format is: begin datetime, end datetime, period, duration

or: begin datetime/ISO 8601 time interval

One can leave out the begin time or end time or both the period and duration

ranges are inclusive unless otherwise specified

N/A N/ANONO
exclude

exclude\[echo_granule_id\]\[\]=G100000006-CMR_PROV

exclude\[concept_id\]\[\]=G100000006-CMR_PROV

exclude\[concept_id\]\[\]=C100000006-CMR_PROV

 
exclude metadata records by echo_granule_id, concept id, or parent concept id. NONO NO NO 

Granule Search Parameters

In the following example we wish to find all collection metadata records that contain an AQUA platform and we would like the to see only a formatted reference list of results that contain 20 references.

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/collections?platform\[\]=AQUA&page_size=20&pretty=true"

In the next example we wish to find all collection metadata records that contain an AQUA or an AURA platform and we would like the to see only a formatted reference list of results that contain 20 references.

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/collections?platform\[\]=AQUA&platform\[\]=AURA&page_size=20&pretty=true"

There are a couple of extra options that certain search parameters have to aid the user.  To use these options the syntax is: options[parameter name][option_key]=value. Parameter name is the name of the search parameter to be affected such as platform. Value is either set to true or false.  Option_key is one of the following:

Option nameDescription
ignore_caseIf "ignore_case" is set to true the search will be case insensitive and if set to false the search will be case sensitive.  The default value is true. E.g. ignore_case=true - the search will match on both AQUA and aqua
patternThis is the wildcard capability. If "pattern" is set to true the CMR will treat '*' as matches zero or more characters and '?' matches any single character. For example: platform[]=AQUA will match only on the value 'AQUA'.  if platform[]=A?U*&options[platform][pattern]=true platforms containing A followed by any alphanumeric character followed by U followed by any number of alphanumeric characters will be found.  So AQUA, ASUBB, ADUSD34H, AUU, etc. will all be found. The pattern option defaults to false.
andIf "and" is set to true and if multiple values are listed for the parameter, the metadata records must contain ALL of these values in order to match. The default is false meaning metadata records that match ANY of the values will match.
orThis option only applies to granule attributes or science-keyword searches. If "or" is set to true, the search will find records that match any of the attributes. The default for this option is false.

Extra Options

The following is an example of using options with the platform search parameter.  This example will find any platform that matches A followed by any number of alphanumeric characters and ends with A. This will find both platforms of AQUA and AURA. 

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/collections.echo10?platform\[\]=A*A&options\[platform\]\[pattern\]=true&pretty=true"

This next example demonstrates a user looking to find records that only contain an instrument that matches "HELLO" in uppercase letters.

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/collections.echo10?instrument\[\]=HELLO&options\[instrument\]\[ignore-case\]=false&pretty=true"

 

Besides science_keywords, if any of the parameters that are searched are repeated, the metadata records that have ANY of the values will match.  The following example demonstrates that the CMR system will match any metadata record containing either value.

 

curl -v -i -H "Echo-Tocken: 75E5CEBE-6BBB-2FB5-A613-0368A361D0B6" -H "Client-Id: Test_Team"  "https://cmr.earthdata.nasa.gov/search/collections.iso?concept_id\[\]=C123456-LPDAAC_ECS&concept_id\[\]=C123457-LPDAAC_ECS&pretty=true"

 

For a complete set of examples using all of the search parameters please see the API documentation: https://cmr.earthdata.nasa.gov/search/site/search_api_docs.html

API calls and parameters POST method

The API using the POST method is the same as with the GET method with the exception being the method used is POST instead of GET and the parameters are in the body of the message without a length constraint instead of existing in the URL string.  Using the curl command the following example shows the query.xml file that contains the query we want to execute followed by the curl search request. In the query.xml file the parameters can be left as one long set or formatted to be more easily read - so long as syntax remains the same. Also notice in this example we did not escape the brackets ([ ])

query.xml:

pretty=true&

page_size=1&

page_num=3&

sort_key[]=platform&platform[]=AQUA&platform[]=AURA&revision_date[]=2015-07-01T01:00:00Z,2016-01-01T01:00:00Z&revision_date[]=2014-01-01T01:00:00Z,2014-06-01T01:00:00Z&temporal[]=2000-01-01T10:00:00Z/2010-03-10T12:00:00Z&include_has_granules=true&include_granule_counts=true&include_facets=true&hierarchical_facets=true


curl -v -XPOST -i -d @query.xml "https://cmr.sit.earthdata.nasa.gov/search/collections.echo10"

Notice in this specific instance that the Content-Type header is not used.  Don't use it, it will cause an error.

JSON query language with a POST method

For those who understand the JSON format, the CMR provides a JSON RESTful interface. The elements that can be searched are the same as already described above but this interface is for collection searches only. This searching method does provide additional functionality of using conditions (AND, OR, NOT) against the elements to conduct a search.  See the JSON schema https://cmr.sit.earthdata.nasa.gov/search/site/JSONQueryLanguage.json for more details.  The example provided below demonstrates a query with conditions and uses several elements.  

curl -XPOST -H "Content-Type: application/json" https://cmr.sit.earthdata.nasa.gov/search/collections
-d '{"condition": { "and": [{ "not": { "or": [{ "provider": "TEST" },
{ "and": [{ "project": "test-project",
"platform": "mars-satellite" }]}]}},
{ "bounding_box": [-45,15,0,25],
"science_keywords": { "category": "EARTH SCIENCE" }}]}}'

 

Alternative Query Language (AQL)

The CMR supports the ECHO Alternative Query Language (AQL) if a client wishes to use this capability. While the AQL is supported it is not being enhanced nor modified to take advantage of new CMR features. For a very detailed explanation of AQL with examples of how to use it, please see the ECHO AQL documentation.  

 

Chapter 4: Retrieving Metadata

There are several ways of retrieving metadata.  The first way consists of getting a result list of full metadata records. This has already been demonstrated, but it is shown again here in the example below.

curl -v -i "https://cmr.sit.earthdata.nasa.gov/search/collections.native?pretty=true"

curl -v -i "https://cmr.sit.earthdata.nasa.gov/search/granules.native?pretty=true"

The response is a result list of full metadata records.  

Another way is to use the concept id to retrieve a record. The syntax is https://cmr.sit.earthdata.nasa.gov/search/concepts/<concept id>. One can also use the concept id/revision number if a specific revision is wanted. The syntax is https://cmr.sit.earthdata.nasa.gov/search/concepts/<concept id>/<revision number>. These examples are shown below.

curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/C1000000803-DEV08"

curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/C1000000803-DEV08/7"

curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/G23447-ASF/8


The CMR supports retrieving metadata records using different standards.  The table below lists these standards.

Type Received
Accept HeaderValue
Supports RevisionSupports GranulesComments
xml

application/xml

YESYESreturns a reference list of results using the XML format
jsonapplication/jsonNOYESreturns a subset of metadata data list of results using the JSON format
echo10application/echo10+xmlYESYESreturns a full metadata record list of results in the echo 10 specification using the XML format
isoapplication/iso19115+xmlYESYESreturns a full metadata record list of results in the ISO 19115-2 (MENDS) specification using the XML format
iso19115application/iso19115+xmlYESYESreturns a full metadata record list of results in the ISO 19115-2 (MENDS) specification using the XML format
difapplication/dif+xmlYESNOsupported for collections only and returns a full metadata record list of results in the DIF 9 specification using the XML format
dif10application/dif10+xmlYESNOsupported for collections only and returns a full metadata record list of results in the DIF 10 specification using the XML format
atomapplication/atom+xmlNOYESreturns a subset of metadata list of results in the ATOM specification using the XML format
nativeapplication/metadata+xml YESYESreturns a full metadata record list of results in their individual native specification using the XML format

Supported Standards

Below are several examples using the supported standards mime types.  The first example is retrieving a granule metadata record in the JSON format. The second example retrieves a granule metadata record with a revision of 8 in the ISO specification. The third example retrieves a collection metadata record with a revision of 7 in the DIF 10 specification. The fourth example lists a granule record using the native format with the pretty print option turned on.

curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/G23447-ASF.json"

 curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/G23447-ASF/8.iso"

curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/C1000000803-DEV08/7.dif10"

curl -v "https://cmr.sit.earthdata.nasa.gov/search/concepts/G23447-ASF.native?pretty=true"

Accessing data

After identifying data of interest through catalog queries, you may place a request for that data if the data provider(s) allow it. To create an request, it is critical that you understand the parts that make up a request
A request is a collection of request items. Each request item consists of:

  • The GUID for the catalog item you wish to request
  • The quantity of the item you wish to request

Other options associated with the item:
Many catalog items belonging to many different providers may comprise a single order. Each provider may have its own validation scheme and rules for creating, validating, and submitting particular catalog items. To ensure appropriate validation – as well as to demarcate a larger request for sending to each provider – requests are split up into smaller provider requests, sometimes called sub-requests. Each provider request includes all the request items in a particular request that belong to a specific provider. Each provider request has its own provider request GUID, a unique identifier comprised of the GUID of the provider and the GUID of the request that contains the catalog items for this provider. The following figure shows the structure of a request.

                                                                                  

CMR Request Structure 

The CMR is designed to support a variety of providers and their various requesting needs, which brings some complexity to the process of request creation. The following figure illustrates the most commonly used and direct approach for creating and submitting a request.

 

                                                                                 

The most common way to obtain the catalog items needed for creating a request is through the ExecuteQuery operation found in the Catalog Service. You can also specify how the results should be displayed. When doing so, ensure that the CatalogItemID tag is returned. The string value under this tag is the actual catalog item GUID that you can use to request items from the CMR.

Access Options 

Access Options use CMR Forms (refer to  http://www.cmr.nasa.gov/data_partners/data_tools10.shtml for more information) for providers to indicate additional information required from users in order to fulfill their orders, such as the media to put the ordered data on and the specific subset of the data to order. Providers assign Order Option definitions to catalog items. When you add an order item to an order that has required order options, it must contain an option selection that corresponds to one of the assigned option definitions for the catalog item you are ordering. See section 1.3 of the CMR Forms Specification for more details. 
To list the possible options for each catalog item, use the GetCatalogItemOrderInfomation operation on the 
OrderManagementService. The operation returns one object called CatalogItemOrderInformation. This contains a list of catalog items and a list of option definitions. Not every option definition in the list applies to every catalog item returned. Each catalog item is associated with zero or more option definition GUIDs, which will be included in the list returned in CatalogItemOrderInformation. Use only one selection from one of the definitions when you add a catalog item to the order. Use your discretion when choosing the definition to use for the order and the selection from within that definition.

Icon

Sometimes a catalog item may not be orderable; GetCatalogItemOrderInformation will return an exception if any catalog item is not orderable. 

Icon

Not all catalog items have associated definitions, in which case they do not need option selections when ordering. However, if there are any options that are required by a catalog item, you are required to fill them out before you can validate and/or submit the order, or else an error will be returned. 

The code listing below shows an example of getting the order options for two granules. 

Code Listing 56: Getting Order Options for a Catalog Item

 

String token = "[token obtained from login]"
// The items we're interested in 
String[] catalogItemGuids = new String[] { "G12345-PROV1""G23456-PROV1" };
Get the service OrderManagementServiceLocator locator = new
 
 
OrderManagementServiceLocator(); OrderManagementServicePort orderService = 
locator.getOrderManagementServicePort();
Get the order information CatalogItemOrderInformation itemInfo =
 
 
orderService.getCatalogItemOrderInformation(token, catalogItemGuids);

 

Icon

In order to utilize the description and sort key option definition fields, clients must use the new complimentary operations. New operations are identified with the number 2, e.g. GetCatalogItemOrderInformation2 utilizes the new OptionDefinition2 type. See the CMR Web Services API documentation for all instances.

Creating an Order

Once you have collected the catalog item GUIDs and associated options, you can create an order by calling the CreateOrder operation on the OrderManagementService. Simply pass an array of item IDs to add to the order. 
Common Selection 
If you are adding one or more items to an order at the same time, and their selections are the same, you can choose a common selection for the CreateOrderAddOrderItemsCreateAndSubmitOrder, and UpdateOrderItems operations that will be applied to all order items passed in without an option selection. This reduces the amount of data transmitted to the CMR and is less resource-intensive because the CMR will need to validate the common selection only once. 
For each item in the array, you should set the following parameters:

Parameters on a Catalog Item

Parameter
Description
ItemGuidThe catalog item GUID from the item's metadata
QuantityOrderedThe quantity of the item you want to order
OptionSelection

Option selection that matches one of the option definitions associated with this item.

If no required option definitions are associated with the item, this will be an empty list.

The other attributes of Order Item should be empty when creating an order; the CMR will populate them automatically. The CMR will process the request and return a GUID identifying the newly created order. The code listing below shows an example of creating a simple order. 

Code Listing 57: Creating a Simple Order

 

OrderItem[] orderItems = new OrderItem[2]; orderItems[0] =
new OrderItem(nullnull"G12345-PROV1"null, (short2null); orderItems[1] =
new OrderItem(nullnull"G23456-PROV1"null, (short2null); String orderGuid = orderService.createOrder(token, orderItems,null);

 

Adding Order Items 
Once you have created an order, you may add other items to it using the AddOrderItems operation. This operation uses the GUID of the target order and a list of items to add. As with CreateOrder, the options other than those listed in the table above should be empty; the CMR will process the additions and return a list of GUIDs identifying these additions. The code listing below shows an example of adding items to an existing order. 

Code Listing 58: Adding Items to an Existing Order

 

orderItems[0] = new OrderItem(nullnull"G34567-PROV1"null, (short2null); 
orderItems[1] = new OrderItem(nullnull"G45678-PROV1"null, (short2null); 
orderService.addOrderItems(token, orderGuid, orderItems,null);

 

Icon

The CMR assigns each item in an order a GUID unique to that order. For example, adding the same granule to two different orders will produce two new GUIDs, one linking the granule to the first order and one linking the granule to the second order. 

Updating Order Items
Once you have added an item to an order, you can modify the options or quantity by calling UpdateOrderItems and passing in the modified items. In this case, you must fill in the GUID of each item since the CMR needs to findthe original item in your order to update it. To ensure you are updating the appropriate item with the correct information, follow these steps:

  • Call GetOrderItems to populate the data.
  • Modify the desired order items.
  • Pass the results to UpdateOrderItems.

The code listing below shows an example of updating an existing item.

 

Code Listing 59: Updating an Item in an Order

 

NameGuid[] itemNames = orderService.getOrderItemNamesByOrder(token, orderGuid); 
String[] orderItemGuids = new String[] { itemNames[0].getGuid() }; 
OrderItem[] items = orderService.getOrderItems(token, orderItemGuids); items[0].setQuantityOrdered((short22); 
orderService.updateOrderItems(token, items,null);

 

Removing Order Items 

You may remove items from an order using the RemoveOrderItems operation as shown below: 

Code Listing 60: Removing an Item from an Order

 

itemNames = orderService.getOrderItemNamesByOrder(token, orderGuid); 
orderItemGuids = new String[] { itemNames[0].getGuid() }; 
orderService.removeOrderItems(token, orderItemGuids);

 

Removing Orders and Canceling Orders

To delete a specific provider order(s), use the RemoveProviderOrders operation. You cannot delete orders that you have already submitted. For post-submittal orders, a registered user can use the CancelOrder operation on the OrderManagementService to cancel an open order. 
Guest orders cannot be deleted in the post-submittal phase; the CancelOrder operation will delete the entire order, including all associated orders.

Setting User Information for an Order

Every order must have its own user-specific information attached to it so that a data provider can process the order. Contact information, billing, and shipping addresses are all required as well as user domain and region. Each order is independent of other orders, so user information must be set up for each order created. 
You may set up user information at any point in the order process prior to submission. User information is not required until you validate, quote, or submit the order. If the required information is not present at that time, you will receive an error. You can set up user information for an order by calling the SetUserInformationForOrder operation on the OrderManagementService.

Validating an Order

To ensure that an order is complete, with all the required options and user-associated information for that order filled out, the CMR validates all orders when submitted or quoted. If you attempt to submit an invalid order, you will receive an error message. Currently, the message reflects only the first validation error encountered; you need to fix the reported error and revalidate until the order is error-free. At this point, if you change any aspect of the validated order before finally submitting it, then the order will again require validation. To validate orders, call SubmitOrder or QuoteOrder. You can manually validate orders with the ValidateOrder operation in the 
OrderManagementService.

Keep in mind that running the ValidateOrder operation may return a validation error related to one of the many provider-specific validation rules, which may change over time. You should find the error messages complete enough to help you determine what aspects of the order you need to correct. 

Note that validation errors can occur if the order specified does not exist, or does not belong to you.

Requesting a Quote for an Order

Requesting a quote is an optional step that not all providers support. A quoted order provides a binding price for the order as a whole. The binding quote response from each of the necessary providers may take a day or more to receive. You cannot make changes to an order while it is in the quoting process. If you make changes to the order subsequent to the receipt of a quote, the changes may invalidate the quoted price. You may request a quote from a provider by calling QuoteOrder.

Submitting a Data Request

Once you have fully validated a data request and have made no subsequent changes to the request, submit the request to the system using the SubmitOrder operation in the OrderManagementService
Specify your preference for receiving order status information using one of the NotificationLevel choices shown in Table 10: CMR Order Notification Levels

CMR Order Notification Levels

Notification Level
Description
VERBOSE

The system will e-mail you all provider order state changes and status message updates.

(See the next table for more on order state changes.)

DETAILThe system will e-mail you provider order state changes only.
INFOThe system will e-mail you when a provider order is closed or canceled.
CRITICALThe system will e-mail you if the order fails during submission or is rejected by the provider. 
NONEThe system will not send e-mail.

If you do not specify any notification level for a registered user's order, the CMR will use your preference value. If you, as a registered user, have not set a preference value, the default value is INFO. The notification for all guests' orders is also INFO
Once an order transmits to the system using the SubmitOrder operation, the CMR sends each provider order contained within your order to the appropriate provider. Each provider will decide whether to accept your provider order and how to process it. 

Tracking and Canceling Orders 
From this point on, you can track the status of an order using the GetOrders operation in the OrderManagementService. At any point before the order actually ships, you may request cancellation of the order through the CancelOrder operation. You can then use the GetOrders operation again to track whether you successfully cancelled the order. 
When the CMR sends a request to a provider to quote, submit or cancel a particular order, both the CMR and that provider must have the same ID for that order. The CMR identifies the specific provider order by the ProviderOrderGUID (which is the combination of the provider GUID and the order GUID). However, the provider may also have its own ID system for tracking a particular provider order. As a solution, the provider order in the CMR also contains a provider-tracking ID. When the provider receives the request from the CMR, the provider has the option to accept the order GUID that the CMR has assigned to that provider order, or to provide the CMR with its own unique ID. If the provider does pass back its own unique ID as the provider-tracking ID, then the CMR will use that ID in addition to the normal CMR ProviderOrderGUID to refer to this provider order. If the provider does not specify a tracking ID, then the provider order will be referenced using only the CMR ProviderOrderGUID.

Order States

An order consists of zero or many provider orders. An order state is calculated based on the state of the individual provider orders that make up the order. The table below shows the order states for orders made up of zero or one provider order or of multiple provider orders having the same provider order state. 

Order States with 0 or 1 Provider Order

# of Provider Orders 

Provider Order StateOrder State
0-NOT_VALIDATED

 

 

1

-Same as provider order state
QUOTE_FAILED

QUOTED_WITH_EXCEPTIONS

QUOTE_REJECTED
SUBMIT_FAILEDSUBMITTED_WITH_EXCEPTIONS
SUBMIT_REJECTED

Restricted or Deleted Order Items 
Some catalog items you may order only with permission. Each provider sets the restrictions and permissions on catalog item ordering. Providers may also delete catalog items at any time. Restrictions can apply to individual users, groups of users or all users. If a catalog item is not available to you, executing the 
CreateAndSubmitOrder, GetCatalogItemOrderInformationCreateOrder, or AddOrderItems operation with this catalog item will return an error message indicating that it is not an orderable item. If an item becomes unavailable after you have created an order, you will receive an error message when you invoke the 
UpdateOrderItemsValidateOrderQuoteOrder, or SubmitOrder operation on that order.

Metadata subscriptions

Appendices

 

Preface

This document provides a look and guide to the Common Metadata Repository (CMR) from the perspective of the Client Partner.

Conventions

  • All references to time are in Universal Time Coordinated (UTC).
  • Data Partners are also referred to as Data Providers.
  • Client Partners are also referred to as Client Developers.
  • Words in bold text are key words or concepts. 

  • Programming examples use a fixed width font, have upper/lower lines separating them 
    from the rest of the text, and are in this color font. 

     

  • Comments (denoted by // within examples) 

  • Best practices or warnings appear in italicized, boxed text.

 

  • No labels