Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CMR Environment

Base API URL (through ECHO)

Associated Earthdata Login (URS) Environment

Operational (OPS)

https://apicmr.echoearthdata.nasa.gov

https://urs.eosdisearthdata.nasa.gov

User Acceptance Test (UAT)

https://api-testcmr.echouat.earthdata.nasa.gov

https://betauat.urs.eosdisearthdata.nasa.gov

Systems Integration Test (SIT)

https://testbedcmr.echosit.earthdata.nasa.gov

https://alphasit.urs.eosdisearthdata.nasa.gov

     

        2. On a terminal window execute the curl command for the environment you selected.

Tip
titleExample

curl -X POST --header "Content-Type: application/xml" -d "<token><username>sample_username</username><password>sample-password</password><client_id>client_name_of_your_choosing</client_id><user_ip_address>your_origin_ip_address</user_ip_address> <provider>Provider Id</provider>address> </token>" https://apicmr.echoearthdata.nasa.gov/echolegacy-services/rest/tokens


Note:

  • Depending on the environment you selected, the Base API URL may be different from the example.  If so, replace the purple text with the correct Base API URL.
  • If you are embedding the token REST messages into a programming language, create an HTTP message and place the same components from the curl example into either the message header or body.
  • The <provider> element in blue in the example above is only used if you are planning on working on behalf of a data provider (ingesting). Client developers (searching) can leave it out. 
  • If you have special characters in your password, you will probably need to escape them using a backslash.

...

If you don't want to escape any characters, but still want to use curl - implement the "file input" option to create a file that looks like the following:

 

 

Tip
titleExample

...

<token>

<username>sample_username</username>
  <password>sample-password</password>
  <client_id>client_name_of_your_choosing</client_id>
  <user_ip_address>your_origin_ip_address</user_ip_address>

...

<

...

/

...

token>

 

...


Note: mytokengenerator.xml can be used as a file name, which simplifies the command.  See example underneath step 2 for original command and the example below for simplified command.

 

Tip
titleExample

...

curl -X POST --header "Content-Type: application/xml" -d @mytokengenerator.xml https://

...

cmr.

...

uat.earthdata.nasa.gov/

...

legacy-services/rest/tokens

Note:

...

if using a programming language, just place the curl example parts into the correct http message header or body locations.

 

Provided a successful response is received, an HTTP success status code of 200 is supplied with the response. Below is a sample response from the curl call - where the value in the ID tag is the token you will use as the value in the Echo-Token header:

 

 


...

titleExample

...

<?xmlversion="1.0"encoding="UTF-8"?>

<token>

<token>

  <id>75E5CEBE-6BBB-2FB5-A613-0368A361D0B6</

...

id>

  <username>sample_username</

...

username>

  <client_id>client_name_of_your_choosing</client_

...

id>

  <user_ip_

...

address>your_origin_ip_address</user_ip_

...

address>

...

<

...

/

...

</token>

token>