AppEEARS token not working
-
- Posts: 2
- Joined: Sat May 18, 2024 3:51 pm America/New_York
AppEEARS token not working
[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!
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:
-
- User Services
- Posts: 422
- Joined: Mon Sep 30, 2019 10:00 am America/New_York
- Has thanked: 31 times
- Been thanked: 8 times
- Contact:
Re: AppEEARS token not working
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.
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.
-
- Posts: 2
- Joined: Sat May 18, 2024 3:51 pm America/New_York
Re: AppEEARS token not working
Hi! I could fix the issue, it was something that I had wrong in my code.
-
- User Services
- Posts: 422
- Joined: Mon Sep 30, 2019 10:00 am America/New_York
- Has thanked: 31 times
- Been thanked: 8 times
- Contact:
Re: AppEEARS token not working
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.
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.