import requests
token = 'YOUR_BEARER_TOKEN'
company_id = 'YOUR_COMPANY_ID'
report_id = 'YOUR_REPORT_ID'
base_url = 'EQUIDAM_BASE_URL' ### e.g. https://obiwan.equidam.com/api/v3
url = f'{base_url}/companies/{company_id}/reports/{report_id}?format=pdf'
headers = {'Authorization': f'Bearer {token}'}
response = requests.get(url, headers=headers, verify=False)
if response.status_code == 200:
with open('filename.pdf', 'wb') as f:
f.write(response.content)
else:
print(f"Request failed with status code {response.status_code}")