Edit

Share via


numberAssignment: assignNumber

Namespace: microsoft.graph.teamsAdministration

Creates an asynchronous order to assign a telephone number to a user account.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) TeamsTelephoneNumber.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application TeamsTelephoneNumber.ReadWrite.All Not available.

HTTP request

POST /admin/teams/telephoneNumberManagement/numberAssignments/assignNumber

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the parameters.

The following table lists the parameters that are required when you call this action.

Parameter Type Description
telephoneNumber String The telephone number intended to be assigned. (Mandatory parameter).
assignmentTargetId String The ID associated with User account. (Mandatory parameter).
numberType microsoft.graph.teamsAdministration.numberType Number type can be direct routing, calling plan, or operator connect. (Mandatory parameter)
assignmentCategory microsoft.graph.teamsAdministration.assignmentCategory Indicates the type of number assignment. Example: primary or private. Default is primary.
locationId String The ID associated with an emergency address.

Response

If successful, the method returns a 202 Accepted response code with the URL in the response Location to retrieve the action result.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/admin/teams/telephoneNumberManagement/numberAssignments/assignNumber
Content-Type: application/json

{
  "telephoneNumber": "12061234567",
  "assignmentTargetId": "94ec379d-30a2-4cdb-a377-75e42f7a61e5",
  "numberType": "directRouting",
  "assignmentCategory": "primary"
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/v1.0/admin/teams/telephoneNumberManagement/operations('QXNzaWdubWVudHw2Y2E4Yjc0Ni00YzgxLTRhY2EtOTUyNi1jZmNjNGRiYWYyMmI')