Page 1 of 1

URS API calls

Posted: Wed Aug 23, 2023 9:31 am America/New_York
by awthird
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?

Re: URS API calls

Posted: Fri Aug 25, 2023 2:03 pm America/New_York
by awthird
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>.