ct_products_listing.py

ct_products_listing.py
import requests
import json

baseURL = "http://library.cdisc.org/api"
queryEndpoint = "/mdr/products"
queryPath = "/Terminology"

# fictitious API key used, real one can be obtained through API Management Developer Portal
req = requests.get(baseURL + queryEndpoint + queryPath, headers={'api-key': 'abcdef0123456789abcdef0123456789', 'Accept': 'application/json'})

if req.status_code == 200:
    resp = json.loads(req.text)
    for package in resp['_links']['packages']:
        print("%s is a %s link for %s" % (package['href'], package['type'], package['title']))