Is their a graph API for microsoft teams admin, where I can assign a phone number to a user?

Jenuel Ganawed 20 Reputation points
2024-04-26T06:41:00.51+00:00

So, I am trying to find an API so that our customer can assign a phone number from our system, and it will call a graph API that would assign the phone number to their users. Is there away? because we don't want our customer to manually setup everything on their Microsoft team's admin portal just to set this up. Thank you so much.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,124 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,663 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,873 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 95,666 Reputation points MVP
    2024-04-26T07:26:56.1633333+00:00

    The officially supported method is via PowerShell and the Set-CsPhoneNumberAssignment. Which in turn calls a RESTful endpoint on the backend, similar to the way Graph API works. But for the time being, there is no official support for performing this operation via Graph.

    If you don't care about the "supported" part, you can get the needed info to build your own solution in one of two ways: capture the network trace from the browser when performing the phone assignment via the Teams admin portal, or capture the network trace when executing the corresponding PowerShell cmdlet. Here are some notes I did on the latter back in the day: https://www.michev.info/blog/post/3870/teams-remote-powershell-updates-and-new-api-endpoints

    0 comments No comments

  2. CarlZhao-MSFT 37,216 Reputation points
    2024-04-26T07:43:53.74+00:00

    Hi @Jenuel Ganawed

    Yes, you can assign a businessPhone number or a mobilePhone number to a user by updating the user.

    User's image

    Before doing so, please check the notes:

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments