Microsoft Graph API to show actual state of Teams user?

%3CLINGO-SUB%20id%3D%22lingo-sub-239830%22%20slang%3D%22en-US%22%3EMicrosoft%20Graph%20API%20to%20show%20actual%20state%20of%20Teams%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-239830%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20a%20requirement%20to%20invite%20external%20(guest)%20users%20into%20Teams%20in%20bulk.%20Current%20goal%20is%20to%20write%20an%20orchestration%20in%20Azure%20Durable%20Functions%20that%20we%20can%20trigger%20from%20various%20business%20events.%20For%20avoidance%20of%20doubt%20this%20is%20authenticating%20to%20Microsoft%20Graph%20with%20app%20credentials.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFollowing%20the%20instructions%20at%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fresources%2Fteams_api_overview%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fresources%2Fteams_api_overview%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20elsewhere%20we%20can%20create%2Finvite%20a%20guest%20user%20and%20add%20them%20to%20an%20existing%20Team.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20documented%2C%20there%20is%20a%20significant%20delay%20between%20adding%20the%20user%20to%20AD%20(which%20directly%20adds%20to%20the%20Office%20365%20group)%20and%20the%20user%20appearing%20in%20Teams.%20However%20contrary%20to%20the%20docs%2C%20even%20using%20the%20beta%20endpoint%20we%20have%20seen%20typical%20delays%20of%202%20to%203%20hours.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20already%20determined%20that%20we%20will%20need%20to%20separate%20creation%20of%20the%20guest%20user%20from%20sending%20an%20invitation%20(by%20taking%20over%20that%20part%20of%20the%20process%2C%20as%20per%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fresources%2Finvitation%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fresources%2Finvitation%3C%2FA%3E)%2C%20and%20we%20want%20to%20delay%20sending%20the%20email%20to%20the%20user%20until%20we%20are%20reasonably%20confident%20that%20the%20user%20will%20be%20present%20in%20Teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlthough%20we%20could%20just%20put%20in%20a%20delay%20of%20(say)%204%20hours%2C%20it%20would%20be%20more%20deterministic%20if%20we%20could%20programmatically%20check%20if%20the%20user%20had%20propagated%20to%20the%20Team.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%20querying%20either%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%3C%2FA%3E%7BgroupId%7D%2Fmembers%20or%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fgroups%2F%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fgroups%2F%3C%2FA%3E%7BgroupId%7D%2Fmembers%20shows%20the%20new%20member%20as%20added%20immediately%2C%20even%20though%20it%20is%20not%20yet%20in%20Teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anyone%20else%20attempted%20this%20problem%20and%20found%20another%20solution%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-239830%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdministrator%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGuest%20Access%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-281036%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Graph%20API%20to%20show%20actual%20state%20of%20Teams%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-281036%22%20slang%3D%22en-US%22%3E%3CP%3ENot%20yet%20-%20we%20parked%20the%20requirement%20and%20set%20up%20an%20external%20forum%20for%20the%20particular%20use%20case%20we%20were%20working%20on.%20Wi%20l%20revisit%20at%20some%20point%20and%20update%20here!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-271725%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Graph%20API%20to%20show%20actual%20state%20of%20Teams%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-271725%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Julian%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20find%20a%20solution%20with%20this%20problem%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1431498%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Graph%20API%20to%20show%20actual%20state%20of%20Teams%20user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1431498%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F179981%22%20target%3D%22_blank%22%3E%40Julian%20Elve%3C%2FA%3E%26nbsp%3Bdid%20this%20ever%20get%20solved%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

We have a requirement to invite external (guest) users into Teams in bulk. Current goal is to write an orchestration in Azure Durable Functions that we can trigger from various business events. For avoidance of doubt this is authenticating to Microsoft Graph with app credentials.

 

Following the instructions at https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/teams_api_overview and elsewhere we can create/invite a guest user and add them to an existing Team.

 

As documented, there is a significant delay between adding the user to AD (which directly adds to the Office 365 group) and the user appearing in Teams. However contrary to the docs, even using the beta endpoint we have seen typical delays of 2 to 3 hours.

 

We have already determined that we will need to separate creation of the guest user from sending an invitation (by taking over that part of the process, as per https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/invitation), and we want to delay sending the email to the user until we are reasonably confident that the user will be present in Teams.

 

Although we could just put in a delay of (say) 4 hours, it would be more deterministic if we could programmatically check if the user had propagated to the Team.

 

Unfortunately querying either https://graph.microsoft.com/v1.0/groups/{groupId}/members or https://graph.microsoft.com/beta/groups/{groupId}/members shows the new member as added immediately, even though it is not yet in Teams.

 

Has anyone else attempted this problem and found another solution?

3 Replies
Highlighted

Hey Julian,

 

Do you find a solution with this problem ?

Highlighted

Not yet - we parked the requirement and set up an external forum for the particular use case we were working on. Wi l revisit at some point and update here!

Highlighted

@Julian Elve did this ever get solved?