The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
I am trying to search for users by email address and have their email returned in the results. I'm using the following url:
/accounts/self/users?include[]=email&search_term=foo@example.com
My searches returns the expected users, but do not include the requested email property in the returned user objects.
I'm using an access token from a Developer Key to authorise my searches and this key has Enforce Scopes enabled.
After some experimentation, I've found that the same search does include the email property in the user objects if I disable Enforce Scopes on the developer key.
Is there a way to do this when Enforce Scopes is enabled? Do I need to enable some other scopes?
I think I may have found the answer myself. Developer Keys - Canvas LMS REST API Documentation says:
Canvas API Includes
Several Canvas APIs allow specifying an include parameter. This parameter allows nesting resources in JSON responses. For example, a request to the assignment index endpoint could be made to include the submission objects for each assignment.Responses to requests made with a scoped access token do not support this functionality. When a request is made with a scoped token Canvas will ignore include and includes parameters.
I hadn't appreciated that by requesting email addresses I might be nesting resources.
Does this mean I need to make a separate request to /users/:id for every result returned from the search or is there a better way to get the email address?
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in