Hello,
I am getting the following message when trying to export the monthly table:
JWT validation failed: Missing or invalid credentials
I am able to get all the other tables fine except for the monthly export one. Here is my full block code:
#Helper method that returns an iterator with the documents from all pages
def get_all(url, headers):
# First request
has_more = True# Keep fetching while there are more records to be returned while has_more: response = requests.get(url, headers=headers) # Return the records to be processed by the caller instead of doing the processing here yield from response.json() url = get_next_page_url(response.headers) has_more = url is not Nonedef get_records(url, auth_headers=combocurve_auth.get_auth_headers()):
df = pd.DataFrame() tmp_list = [] for record in get_all(url, auth_headers): tmp_list.append(record) return pd.DataFrame(tmp_list).reset_index(drop=True)
And executing this particular project:
project_id = ‘6224a9db21aea9001311d1c7’
url = f’https://api.combocurve.com/v1/projects/{project_id}/wells?take=200’project_wells = get_records(url)
url = f’https://api.combocurve.com/v1/projects/{project_id}/monthly-productions?take=200’
project_production = get_records(url)
url = f’https://api.combocurve.com/v1/projects/{project_id}/scenarios?take=200’
project_scenarios = get_records(url)
project_scenariosscenario_id = project_scenarios.id[0]
url = f’https://api.combocurve.com/v1/projects/{project_id}/scenarios/{scenario_id}/econ-runs?take=200’
project_econ_runs = get_records(url)
econ_id = project_econ_runs.id[0]
econ_idwell_ids = list(project_wells.id.unique())
well_idsmonthly_export_table = pd.DataFrame()
for well_id in well_ids:
url = f’https://api.combocurve.com/v1/projects/{project_id}/scenarios/{scenario_id}/econ-runs/{econ_id}/monthly-exports/{well_id}?skip=0&take=100’
print(url)
monthly_export = get_records(url)monthly_export_table = pd.concat([monthly_export_table,monthly_export])monthly_table = monthly_table.reset_index(drop=True)
