Files
Gainsight/Scripts/API_Tests/training_events.py

16 lines
387 B
Python
Raw Permalink Normal View History

import requests
import Apikeys
import pprint
pp = pprint.PrettyPrinter(indent=4)
apikey = Apikeys.SPS
url = "https://api.northpass.com/v2/training_events"
headers = {"accept": "application/json", "X-Api-Key": apikey}
response = requests.get(url, headers=headers)
resp = response.json()
for item in resp["data"]:
name = item["attributes"]["title"]
print(name)
# pp.pprint(resp)