Forum Discussion

DMarcolo's avatar
DMarcolo
Copper Contributor
Jul 06, 2020
Solved

Generate Team/Channel link via API

Hi everyone,

I would like some help with the Microsoft API Graph - Teams product. I'm creating a new app in my Azure Directory to be able to interact with the Teams and groups that exists within this directory. I was able to create a group, some users, a team and some channels via API. I was wondering if there's any way to generate or get the channel link from any team/channel related endpoint. I saw that from the "me/joinedTeams" details there's a field named webUrl, but it's always empty for any teams I'm in. 

 

Another thing I was trying to achieve is to get some "pre-authenticated" link for a specific user, with a direct access to a joined team or a team in general. Let me explain this : 

- I'm able to authenticate my app on behalf of a user

- I'm able to refresh and renew authentication via the auth/refresh token for a given user

Now at this point, I can act as a user. But how can I generate/get some sort of deep link or authenticated deep link where anyone ( who possess this link ) can click and via this link, be logged as given/chosen user automatically, causing the load/open of the team (web/app) directly with the selected user on the proper/provided team channel?

 

Thanks

  • Hi DMarcolo ,

     

    So in terms of getting the Channel link for a Channel of a Team:

    GET /teams/{TeamId}

    GET /teams/{TeamId}/channels

     

    And to specify a link that will take you within a Channel of a Team an example is shown here:
    https://teams.microsoft.com/l/team/{ChannelId}/conversations?tenantId={TenantId}

    "webUrl":

    https://teams.microsoft.com/_#/conversations/General?threadId=19:b91a8b7e7b1046e78b21c4d405eb3003@thread.tacv2&ctx=channel

    Reference Documentation:
    https://docs.microsoft.com/en-us/graph/api/team-get?view=graph-rest-1.0&tabs=http
    https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0&tabs=http
     
    And have a play at: https://aka.ms/ge
     

    Thanks

     

    Henry

     

     

4 Replies

  • Hi DMarcolo ,

     

    So in terms of getting the Channel link for a Channel of a Team:

    GET /teams/{TeamId}

    GET /teams/{TeamId}/channels

     

    And to specify a link that will take you within a Channel of a Team an example is shown here:
    https://teams.microsoft.com/l/team/{ChannelId}/conversations?tenantId={TenantId}

    "webUrl":

    https://teams.microsoft.com/_#/conversations/General?threadId=19:b91a8b7e7b1046e78b21c4d405eb3003@thread.tacv2&ctx=channel

    Reference Documentation:
    https://docs.microsoft.com/en-us/graph/api/team-get?view=graph-rest-1.0&tabs=http
    https://docs.microsoft.com/en-us/graph/api/channel-list?view=graph-rest-1.0&tabs=http
     
    And have a play at: https://aka.ms/ge
     

    Thanks

     

    Henry

     

     

    • DMarcolo's avatar
      DMarcolo
      Copper Contributor

      Thanks HenryPhillipsNimbitech , 

      now I see/have the team link and channel link correctly!

       

      What about "pre-authenticated" link ? 

      Is there a way to generate a pre-authenticated link that overtake the SignIn process?

      Like: I want to generate, via API, a link for a specific user that point to a specific team/team channel. Clicking on this link user will be auto LoggedIn to the given Team. I know that API is mainly meant to process things "backend" and is not a standard flow, but this might be an expected process. Since I'm able to act on behalf of a user I should be able to give him a fast way to directly log in into Teams without doing a LogIn every time ( eventually with a limited time frame to do this "auto login" ).

       

      Does the API have something to achieve this ?

       

      ThereseSolimeno 

      • HenryPhillipsNimbitech's avatar
        HenryPhillipsNimbitech
        Bronze Contributor

        Hi DMarcolo ,

        The best I can do is refer you to:https://docs.microsoft.com/en-gb/graph/auth/?context=graph%2Fapi%2F1.0&view=graph-rest-1.0

         

        You could also try reaching out to one of the Microsoft Graph team by way of Twitter too.

         

        Thanks

         

        Henry

Resources