Created
April 25, 2021 11:54
-
-
Save anna-anisienia/5d7fba7b65a2093bf44bfc6681479954 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from pprint import pprint | |
base_url = "http://localhost:3000/api" | |
auth = {"Authorization": "Bearer YWRtaW46Ym9vdHN0cmFwOmFkbWluMTIz"} | |
workspaces = requests.get(f"{base_url}/entities/workspaces", headers=auth) | |
data = workspaces.json().get("data") | |
workspace_id = data[0].get("id") | |
dashboards = requests.get(f"{base_url}/entities/workspaces/{workspace_id}/analyticalDashboards", | |
headers=auth) | |
dashboards_data = dashboards.json().get("data") | |
pprint(dashboards_data) | |
metrics = requests.get(f"{base_url}/entities/workspaces/{workspace_id}/metrics", headers=auth) | |
metrics_data = metrics.json().get("data") | |
pprint(metrics_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment