I need some help determining the organizationId to use in my API URLs. I query /organizations to get the organization ID then use that to get the Apple Push Notification Certificate. Problem is I get a 404 Error when using the organization ID. Here's my code: import requests, json
from OpenSSL import crypto
apiKey = '<my_api_key>'
baseApiUrl = 'https://api.meraki.com/api/v0'
merakiOrgname = '<my_org_name>'
merakiHeader = {
'X-Cisco-Meraki-API-Key': apiKey,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
organizations = requests.get(baseApiUrl+'/organizations', allow_redirects=True, headers=merakiHeader)
if organizations.status_code >= 200 and organizations.status_code < 300:
for org in organizations.json():
if org.get('name') == merakiOrgname:
merakiOrgId = org.get('id')
applePushCertRequest = requests.get(baseApiUrl+'/organizations/{'+merakiOrgId+'}/sm/apnsCert', allow_redirects=True, headers=merakiHeader)
if applePushCertRequest.status_code >= 200 and organizations.status_code < 300:
applePushCert = crypto.load_certificate(crypto.FILETYPE_PEM, applePushCertRequest.text)
print(applePushCert.get_notAfter()) I also tried using the url in this format: applePushCertRequest = requests.get(baseApiUrl+'/organizations/'+merakiOrgId+'/sm/apnsCert', allow_redirects=True, headers=merakiHeader)
... View more