AppEEARS token not working
Posted: 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!
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!