AnsweredAssumed Answered

How to Get all users in API Communication Channel Request

Question asked by Carrenda @Distance Learning on Mar 28, 2018
Latest reply on Apr 7, 2018 by Jeremy Perkins

Hello,

I'm new to APIs and have successfully been able to use a Get request to retrieve user information, but I want to be able to pull all users and not just a specific user as I have done so far.

 

We now require students to use their school emails in Canvas and made the change via automated SIS import this week. The problem is there seem to be some users where their school address came in as a secondary email instead of replacing the default(I assume due to them manually changing it in Canvas). My end goal is to find all users with a secondary email in Canvas so that those addresses can be removed.

 

My Question to you is now that I've successfully retrieved information for a specific user how do I pull all users in the Get request? I put an asterisk(*) where the user ID would go, but that did not work.

 

If needed, I'm using a code like below to retrieve Communication Channel Information

 

import requests
import json

 

url = 'https://<school>.instructure.com/api/v1/users/<user_id>/communication_channels'
headers = {'Authorization' : 'Bearer <token>'}


r = requests.get(url,headers = headers)

 

print(r.status_code)
print(r.text)
print(r.json())

Outcomes