import requests
from pprint import pprint
import config
# Define the base URL without the access token
url = config.api_url
key = config.ACCESS_TOKEN
# Define the URL parameters
params = {
'scope': 'global'
}
# Define the headers, including the Authorization header with the Bearer token
headers = {
'Authorization': f'Bearer {key}'
}
response = requests.get(url, params=params, headers=headers, verify=True)
results = response.text
pprint(results)
'''
('#config-version=FGT61F-7.2.12-FW-build1761-250909:opmode=0:vdom=0:user=NetAdmin_API\n'
This line will not write in json to a file.
'''