Found the solution myself. The trick is to get the shard domain of the organization's dashboard before initializing the API. import requests
import meraki
from environment_variables import MERAKI_API_KEY, ORG_ID
def get_base_url(org_id: str):
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Cisco-Meraki-API-Key": MERAKI_API_KEY
}
response = requests.request('GET', f'https://api.meraki.com/api/v1/organizations/{org_id}', headers=headers)
organization = response.json()
shard_domain = re.search('https?://([A-Za-z_0-9.-]+).*', organization['url']).group(1)
return f'https://{shard_domain}/api/v1'
base_url = get_base_url(ORG_ID)
dashboard_api = meraki.DashboardAPI(MERAKI_API_KEY, base_url=base_url)
... View more