.netmicrosoft-graph-apimicrosoft-teams

How to generate a SkypeToken for Teams native APIs?


I am working on posting messages on Teams channels. I've been using the Graph APIs but I am facing a huge amount of throttling so I wanted to switch to the Native APIs used when posting a message through the Teams GUI. These APIs work with a token called SkypeToken that I am trying to generate. I have seen threads like this Adding invited (guest) user to teams seems to not work properly talking about how to generate it but it seems that this no longer works as I am receiving a 404 not found on the endpoint https://api.teams.skype.com/beta/auth/skypetoken queried to get the token. Does anyone know what the new endpoint is or any other way to generate this token?


Solution

  • After some digging and following the Fiddler network trace when opening Teams on the web, I could find what the new URL to get the Skype token is. Long story short, this Powershell code works fine https://github.com/sanderdewit/teams-module/blob/master/teams_v2.psm1 except that the API URL has changed. You can just change it with the new URL "https://authsvc.teams.microsoft.com/v1.0/authz" and you will get your SkypeToken.