Namespace: microsoft.graph.teamsAdministration
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Read the properties and relationships of microsoft.graph.teamsAdministration.numberAssignment object.
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.Read.All |
TeamsTelephoneNumber.ReadWrite.All |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
TeamsTelephoneNumber.Read.All |
TeamsTelephoneNumber.ReadWrite.All |
HTTP request
GET /admin/teams/telephoneNumberManagement/numberAssignments
Optional query parameters
This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters. The following optional parameters are supported:
$filter: Use the $filter query parameter to retrieve just a subset of a collection. For example, you can use the $filter parameter to retrieve those telephone numbers with numberType equals DirectRouting. Filter can be applied by appending the following expression to the query $filter=numberType eq ‘DirectRouting’. All fields from the number assignments can be filtered except id and city.
$Top: Use the $Top parameter to return first “X” number of results. Default number of results is 500 entries and maximum 1,000 entries allowed per query.
$Skip: Use the $Skip query parameter to skip first “X” number of results. Default value is 0
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK response code and a collection of numberAssignment objects in the response body.
Examples
Example 1
Request
The following example shows a request to get a list of all telephone numbers, including assignment details.
GET https://graph.microsoft.com/beta/admin/teams/telephoneNumberManagement/numberAssignments
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.Teams.TelephoneNumberManagement.NumberAssignments.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
numberAssignments, err := graphClient.Admin().Teams().TelephoneNumberManagement().NumberAssignments().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.teamsadministration.NumberAssignmentCollectionResponse result = graphClient.admin().teams().telephoneNumberManagement().numberAssignments().get();
const options = {
authProvider,
};
const client = Client.init(options);
let numberAssignments = await client.api('/admin/teams/telephoneNumberManagement/numberAssignments')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->admin()->teams()->telephoneNumberManagement()->numberAssignments()->get()->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.admin.teams.telephone_number_management.number_assignments.get()
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": {
"@odata.type": "#microsoft.graph.teamsAdministration.numberAssignment",
"id": "YmMyNjMyZTMtNzUwYy00N2Q3LWFlYWUtOWZlZTAzNWJjMGM3fCsxMjAyMzQ1Njc4OA",
"telephoneNumber": "+112345",
"operatorId": "7a205197-8e59-487d-b9fa-3fc1b108f1e5",
"numberType": "directRouting",
"activationState": "activated",
"capabilities": [
"conferenceAssignment",
"voiceApplicationAssignment",
"userAssignment"
],
"locationId": null,
"civicAddressId": null,
"networkSiteId": null,
"assignmentTargetId": "22ed44ab-7759-4649-818e-6af3242dbc5d",
"assignmentCategory": "primary",
"portInStatus": null,
"assignmentStatus": "userAssigned",
"isoCountryCode": null,
"city": null,
"numberSource": "online",
"supportedCustomerActions": [
"locationUpdate"
],
"reverseNumberLookupOptions": []
},
"value": {
"@odata.type": "#microsoft.graph.teamsAdministration.numberAssignment",
"id": "YmMyNjMyZTMtNzUwYy00N2Q3LWFlYWUtOWZlZTAzNWJjMGM3fCsxMjAyMzQ1Njc4OQ",
"telephoneNumber": "+12052582895",
"operatorId": "0019adbc-b82a-47b4-a799-4e993a9982f1",
"numberType": "callingPlan",
"activationState": "activated",
"capabilities": [
"conferenceAssignment"
],
"locationId": null,
"civicAddressId": null,
"networkSiteId": null,
"assignmentTargetId": "207a6836-d031-4764-a9d8-c1193f455f21",
"assignmentCategory": "primary",
"portInStatus": null,
"assignmentStatus": "conferenceAssigned",
"isoCountryCode": "US",
"city": "Clanton",
"numberSource": "online",
"supportedCustomerActions": [
"locationUpdate",
"release"
],
"reverseNumberLookupOptions": []
}
}
Example 2
Request
The following example shows a request to get a list of telephone numbers based on a filter.
GET https://graph.microsoft.com/beta/admin/teams/telephoneNumberManagement/numberAssignments?$filter=assignmentStatus eq 'unassigned' and capabilities/any(c:c eq 'userAssignment')
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.Teams.TelephoneNumberManagement.NumberAssignments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "assignmentStatus eq 'unassigned' and capabilities/any(c:c eq 'userAssignment')";
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphadmin "github.com/microsoftgraph/msgraph-beta-sdk-go/admin"
//other-imports
)
requestFilter := "assignmentStatus eq 'unassigned' and capabilities/any(c:c eq 'userAssignment')"
requestParameters := &graphadmin.TeamsTelephoneNumberManagementNumberAssignmentsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphadmin.TeamsTelephoneNumberManagementNumberAssignmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
numberAssignments, err := graphClient.Admin().Teams().TelephoneNumberManagement().NumberAssignments().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.teamsadministration.NumberAssignmentCollectionResponse result = graphClient.admin().teams().telephoneNumberManagement().numberAssignments().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "assignmentStatus eq 'unassigned' and capabilities/any(c:c eq 'userAssignment')";
});
const options = {
authProvider,
};
const client = Client.init(options);
let numberAssignments = await client.api('/admin/teams/telephoneNumberManagement/numberAssignments')
.version('beta')
.filter('assignmentStatus eq \'unassigned\' and capabilities/any(c:c eq \'userAssignment\')')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\Teams\TelephoneNumberManagement\NumberAssignments\NumberAssignmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new NumberAssignmentsRequestBuilderGetRequestConfiguration();
$queryParameters = NumberAssignmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "assignmentStatus eq 'unassigned' and capabilities/any(c:c eq 'userAssignment')";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->teams()->telephoneNumberManagement()->numberAssignments()->get($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.admin.teams.telephone_number_management.number_assignments.number_assignments_request_builder import NumberAssignmentsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = NumberAssignmentsRequestBuilder.NumberAssignmentsRequestBuilderGetQueryParameters(
filter = "assignmentStatus eq 'unassigned' and capabilities/any(c:c eq 'userAssignment')",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.teams.telephone_number_management.number_assignments.get(request_configuration = request_configuration)
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": {
"@odata.type": "#microsoft.graph.teamsAdministration.numberAssignment",
"id": "YmMyNjMyZTMtNzUwYy00N2Q3LWFlYWUtOWZlZTAzNWJjMGM3fCsxMjAzNDU2Nzgy",
"telephoneNumber": "+1123457",
"operatorId": "7a205197-8e59-487d-b9fa-3fc1b108f1e5",
"numberType": "directRouting",
"activationState": "activated",
"capabilities": [
"conferenceAssignment",
"voiceApplicationAssignment",
"userAssignment"
],
"locationId": null,
"civicAddressId": null,
"networkSiteId": null,
"assignmentTargetId": null,
"assignmentCategory": null,
"portInStatus": null,
"assignmentStatus": "unassigned",
"isoCountryCode": null,
"city": null,
"numberSource": "online",
"supportedCustomerActions": [
"locationUpdate"
],
"reverseNumberLookupOptions": []
}
}
Example 3
Request
The following example shows a request to get a list of telephone numbers using $top and $skip for pagination.
GET https://graph.microsoft.com/beta/admin/teams/telephoneNumberManagement/numberAssignments?$top=100&$skip=200
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.Teams.TelephoneNumberManagement.NumberAssignments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Top = 100;
requestConfiguration.QueryParameters.Skip = 200;
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphadmin "github.com/microsoftgraph/msgraph-beta-sdk-go/admin"
//other-imports
)
requestTop := int32(100)
requestSkip := int32(200)
requestParameters := &graphadmin.TeamsTelephoneNumberManagementNumberAssignmentsRequestBuilderGetQueryParameters{
Top: &requestTop,
Skip: &requestSkip,
}
configuration := &graphadmin.TeamsTelephoneNumberManagementNumberAssignmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
numberAssignments, err := graphClient.Admin().Teams().TelephoneNumberManagement().NumberAssignments().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.teamsadministration.NumberAssignmentCollectionResponse result = graphClient.admin().teams().telephoneNumberManagement().numberAssignments().get(requestConfiguration -> {
requestConfiguration.queryParameters.top = 100;
requestConfiguration.queryParameters.skip = 200;
});
const options = {
authProvider,
};
const client = Client.init(options);
let numberAssignments = await client.api('/admin/teams/telephoneNumberManagement/numberAssignments')
.version('beta')
.skip(200)
.top(100)
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\Teams\TelephoneNumberManagement\NumberAssignments\NumberAssignmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new NumberAssignmentsRequestBuilderGetRequestConfiguration();
$queryParameters = NumberAssignmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->top = 100;
$queryParameters->skip = 200;
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->teams()->telephoneNumberManagement()->numberAssignments()->get($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.admin.teams.telephone_number_management.number_assignments.number_assignments_request_builder import NumberAssignmentsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = NumberAssignmentsRequestBuilder.NumberAssignmentsRequestBuilderGetQueryParameters(
top = 100,
skip = 200,
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.teams.telephone_number_management.number_assignments.get(request_configuration = request_configuration)
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": {
"@odata.type": "#microsoft.graph.teamsAdministration.numberAssignment",
"id": "YmMyNjMyZTMtNzUwYy00N2Q3LWFlYWUtOWZlZTAzNWJjMGM3fCsxMjAyMzQ1Njc4OA",
"telephoneNumber": "+112345",
"operatorId": "7a205197-8e59-487d-b9fa-3fc1b108f1e5",
"numberType": "directRouting",
"activationState": "activated",
"capabilities": [
"conferenceAssignment",
"voiceApplicationAssignment",
"userAssignment"
],
"locationId": null,
"civicAddressId": null,
"networkSiteId": null,
"assignmentTargetId": "22ed44ab-7759-4649-818e-6af3242dbc5d",
"assignmentCategory": "primary",
"portInStatus": null,
"assignmentStatus": "userAssigned",
"isoCountryCode": null,
"city": null,
"numberSource": "online",
"supportedCustomerActions": [
"locationUpdate"
],
"reverseNumberLookupOptions": []
},
"value": {
"@odata.type": "#microsoft.graph.teamsAdministration.numberAssignment",
"id": "YmMyNjMyZTMtNzUwYy00N2Q3LWFlYWUtOWZlZTAzNWJjMGM3fCsxMjAyMzQ1Njc4OQ",
"telephoneNumber": "+12052582895",
"operatorId": "0019adbc-b82a-47b4-a799-4e993a9982f1",
"numberType": "callingPlan",
"activationState": "activated",
"capabilities": [
"conferenceAssignment"
],
"locationId": null,
"civicAddressId": null,
"networkSiteId": null,
"assignmentTargetId": "207a6836-d031-4764-a9d8-c1193f455f21",
"assignmentCategory": "primary",
"portInStatus": null,
"assignmentStatus": "conferenceAssigned",
"isoCountryCode": "US",
"city": "Clanton",
"numberSource": "online",
"supportedCustomerActions": [
"locationUpdate",
"release"
],
"reverseNumberLookupOptions": []
}
}
Example 4
Request
The following example shows a request to get assignment details for a single telephone number using a filter.
GET https://graph.microsoft.com/beta/admin/teams/telephoneNumberManagement/numberAssignments?$filter=telephoneNumber eq '+12052582895'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.Teams.TelephoneNumberManagement.NumberAssignments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "telephoneNumber eq ' 12052582895'";
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphadmin "github.com/microsoftgraph/msgraph-beta-sdk-go/admin"
//other-imports
)
requestFilter := "telephoneNumber eq ' 12052582895'"
requestParameters := &graphadmin.TeamsTelephoneNumberManagementNumberAssignmentsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphadmin.TeamsTelephoneNumberManagementNumberAssignmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
numberAssignments, err := graphClient.Admin().Teams().TelephoneNumberManagement().NumberAssignments().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.teamsadministration.NumberAssignmentCollectionResponse result = graphClient.admin().teams().telephoneNumberManagement().numberAssignments().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "telephoneNumber eq ' 12052582895'";
});
const options = {
authProvider,
};
const client = Client.init(options);
let numberAssignments = await client.api('/admin/teams/telephoneNumberManagement/numberAssignments')
.version('beta')
.filter('telephoneNumber eq \' 12052582895\'')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\Teams\TelephoneNumberManagement\NumberAssignments\NumberAssignmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new NumberAssignmentsRequestBuilderGetRequestConfiguration();
$queryParameters = NumberAssignmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "telephoneNumber eq ' 12052582895'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->teams()->telephoneNumberManagement()->numberAssignments()->get($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.admin.teams.telephone_number_management.number_assignments.number_assignments_request_builder import NumberAssignmentsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = NumberAssignmentsRequestBuilder.NumberAssignmentsRequestBuilderGetQueryParameters(
filter = "telephoneNumber eq ' 12052582895'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.teams.telephone_number_management.number_assignments.get(request_configuration = request_configuration)
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": {
"@odata.type": "#microsoft.graph.teamsAdministration.numberAssignment",
"id": "YmMyNjMyZTMtNzUwYy00N2Q3LWFlYWUtOWZlZTAzNWJjMGM3fCsxMjAzNDU2Nzcy",
"telephoneNumber": "+12052582895",
"operatorId": "7a205197-8e59-487d-b9fa-3fc1b108f1e5",
"numberType": "directRouting",
"activationState": "activated",
"capabilities": [
"voiceApplicationAssignment",
"userAssignment"
],
"locationId": null,
"civicAddressId": null,
"networkSiteId": null,
"assignmentTargetId": null,
"assignmentCategory": null,
"portInStatus": null,
"assignmentStatus": "unassigned",
"isoCountryCode": null,
"city": null,
"numberSource": "online",
"supportedCustomerActions": [
"locationUpdate"
],
"reverseNumberLookupOptions": []
}
}