Hi,
It looks like the Show Module Item API call returns a ModuleItem object which includes the type of a module item (ExternalTool). I don't have an example of that exact call but here's some code to get you started, just change the API endpoint URL.
import requests, json
data_set = []
headers = {
'Authorization': 'Bearer 15691~dsfasdfsdfsd',
'per_page':'100' #You'll need to loop through pages if you have 1000's courses
}
#List all courses
uri = 'https://banana.instructure.com/api/v1/courses?per_page=50'
r = requests.get(uri, headers=headers)
raw = r.json()
parsed = json.loads(r.text)
#print(json.dumps(parsed, indent=4, sort_keys=True))
print("ID \t Blueprint \t Name")
for course in parsed:
print(course['id'],"\t",course['blueprint'],"\t\t",course['name'])
#List details of a single course
uri = 'https://banana.instructure.com/api/v1/courses/42'
r = requests.get(uri, headers=headers)
parsed = json.loads(r.text)
print(json.dumps(parsed, indent=4, sort_keys=True))
#List settings of a single course
uri = 'https://banana.instructure.com/api/v1/courses/42/settings'
r = requests.get(uri, headers=headers)
parsed = json.loads(r.text)
print(json.dumps(parsed, indent=4, sort_keys=True))
:wq
Paul
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.