URS API calls

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
awthird
Posts: 2
Joined: Mon Aug 21, 2023 3:32 pm America/New_York
Answers: 0

URS API calls

by awthird » Wed Aug 23, 2023 9:31 am America/New_York

I can't seem to get a sensible response in using the URS API to search for a user by UID. I'm using curl like this:

curl --request GET --url https://urs.earthdata.nasa.gov/api/users/uid=<my_own_uid> --header 'Authorization: Bearer <my_own_token>'

The response I get is an HTML redirect to https://urs.earthdata.nasa.gov/home.

What I expected was JSON, not HTML, and not to be redirected since I am already logged into URS - it's where I copied the token from. What am I doing wrong?

Filters:

awthird
Posts: 2
Joined: Mon Aug 21, 2023 3:32 pm America/New_York
Answers: 0

Re: URS API calls

by awthird » Fri Aug 25, 2023 2:03 pm America/New_York

Operator error. I had the wrong URL. Instead of https://urs.earthdata.nasa.gov/api/users/uid=<my_own_uid>, it should have been https://urs.earthdata.nasa.gov/api/users/<my_own_uid>.

Post Reply