Bundle Python API
Posted: Mon Sep 05, 2022 1:00 am America/New_York
Hello,
I am trying to get a list of files from the bundle API endpoint, so that I can can bulk download them instead of downloading each file one by one from the UI tasks page. My problem is the GET bundle/{task_id} endpoint does not seem to work, returning a 403 error. The bearer token seems to be correct, as I am able to perform other account based activities like submitting and listing tasks.
```
# List bundle
def list_bundle(task_id:str, headers:dict):
endpoint = f'https://appeears.earthdatacloud.nasa.gov/api/bundle/{task_id}'
r = requests.get(endpoint, headers)
if r.status_code not in range (200, 299):
return r.status_code, r.json()
return r.json()
```
```
list_bundle('bd5964fc-2812-4449-9a97-1913b1c2b05f', headers=headers)
```
Thanks
I am trying to get a list of files from the bundle API endpoint, so that I can can bulk download them instead of downloading each file one by one from the UI tasks page. My problem is the GET bundle/{task_id} endpoint does not seem to work, returning a 403 error. The bearer token seems to be correct, as I am able to perform other account based activities like submitting and listing tasks.
```
# List bundle
def list_bundle(task_id:str, headers:dict):
endpoint = f'https://appeears.earthdatacloud.nasa.gov/api/bundle/{task_id}'
r = requests.get(endpoint, headers)
if r.status_code not in range (200, 299):
return r.status_code, r.json()
return r.json()
```
```
list_bundle('bd5964fc-2812-4449-9a97-1913b1c2b05f', headers=headers)
```
Thanks