AppEEARS token not working

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
juanessao2000
Posts: 2
Joined: Sat May 18, 2024 3:51 pm America/New_York
Answers: 0

AppEEARS token not working

by juanessao2000 » Sat May 18, 2024 4:11 pm America/New_York

[18/05/2024]

Hello everyone!

I am following the tutorial posted on this link

github https://github.com/nasa/AppEEARS-Data-Resources/blob/main/Python/tutorials/AppEEARS_API_Point.ipynb


to learn how to use the AppEEARS api. However, after requesting the token in this lines of code (section 1b)

```
token_response = r.post('{}login'.format(api), auth=(user, password)).json() # Insert API URL, call login service, provide credentials & return json
del user, password # Remove user and password information
token_response # Print response

```
I later use it for sending the task to the API in the following lines (section 3b)

```
task_response = r.post('{}task'.format(api), json=task, headers=head).json() # Post json to API task service, return response as json
task_response
```

However, I am getting the following error

{'message': "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server."}

As I understood, the only requirement for generating a valid token was having the username and password for NASA earthdata, then I don't understand why this message is showing. I also have the AppEEARS and the LP DAAC Data pool applications authorized in my login dashboard.

Any help you could lend me, is appreciated.

Thanks in advance!

Filters:

LP DAAC - dgolon
User Services
User Services
Posts: 324
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 24 times
Been thanked: 4 times
Contact:

Re: AppEEARS token not working

by LP DAAC - dgolon » Mon May 20, 2024 10:29 am America/New_York

Hello @juanessao2000 Thank you for writing in. We do see that you were able to successfully submit requests via the AppEEARS API after writing in. Could you please let us know if you are still having an issue? Thanks --Danielle
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

juanessao2000
Posts: 2
Joined: Sat May 18, 2024 3:51 pm America/New_York
Answers: 0

Re: AppEEARS token not working

by juanessao2000 » Mon May 20, 2024 10:58 am America/New_York

Hi! I could fix the issue, it was something that I had wrong in my code.

LP DAAC - dgolon
User Services
User Services
Posts: 324
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 24 times
Been thanked: 4 times
Contact:

Re: AppEEARS token not working

by LP DAAC - dgolon » Mon May 20, 2024 2:10 pm America/New_York

Glad to hear you were able to get your code working. :) Please let us know if you have any additional questions. Thanks -- Danielle
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

Post Reply