Sponsors field export

JOhn Works 0 Reputation points
2024-11-30T00:54:36.3533333+00:00

Looking to export all the guest users along with the "Sponsors" field using - https://graph.microsoft.com/v1.0/users?$filter=userType+eq+'guest'&$select=id,displayName,mail,city,Sponsors

However, "Sponsors" doesn't show up.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,447 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 109.2K Reputation points MVP
    2024-11-30T15:24:17.57+00:00

    That's because sponsors is a reference/navigation property, so you either need to use individual queries against /users/{id}/sponsors or leverage the $expand operator:

    GET https://graph.microsoft.com/v1.0/users?$filter=userType+eq+'guest'&$select=id,displayName,mail,city&$expand=sponsors($select=id,userPrincipalName)
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.