This is a sample code snippet to query Teams user objectId from Graph - https://learn.microsoft.com/en-us/azure/communication-services/concepts/interop/custom-teams-endpoint-use-cases#steps-2
To manually find the Teams user objectId, we have this - https://learn.microsoft.com/en-us/azure/communication-services/concepts/troubleshooting-info?tabs=csharp%2Cios%2Cdotnet#getting-user-id