Muokkaa

Jaa


callRecord: getPstnBlockedUsersLog

Namespace: microsoft.graph.callRecords

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.

Get the log of users who are blocked/unblocked from making public switched telephone network (PSTN) calls in Microsoft Teams as a collection of pstnBlockedUsersLogRow entries. The log includes information about each blocked user such as their assigned phone number and the reason they were blocked/unblocked from making calls.

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) Not supported. Not supported.
Delegated (personal Microsoft account) Not supported. Not supported.
Application CallRecords.Read.All Not available.

HTTP request

GET /communications/callRecords/getPstnBlockedUsersLog(fromDateTime={fromDateTime},toDateTime={toDateTime})

Function parameters

In the request URL, provide the following query parameters with values.

Parameter Type Description
fromDateTime DateTimeOffset Start of time range to query. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Required.
toDateTime DateTimeOffset End of time range to query. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Required.

Important

The fromDateTime and toDateTime values can't be more than a date range of 90 days.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this function returns a 200 OK response code and a collection of microsoft.graph.callRecords.pstnBlockedUsersLogRow entries in the response body.

If the function returns more than 1,000 entries for the specified date range, the body also includes an @odata.nextLink with a URL to query the next page of entries. The last page in the date range doesn't have an @odata.nextLink. For more information, see paging Microsoft Graph data in your app.

Example

The following example shows how to get a collection of records for PSTN blocked users that occurred in the specified date range. The response includes "@odata.count": 1000 to enumerate the number of records in the first response, and an @odata.nextLink to get records beyond the first 1,000. For readability, the response object contains only a collection of two records.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/communications/callRecords/getPstnBlockedUsersLog(fromDateTime=2022-11-01,toDateTime=2022-12-01)

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.callRecords.pstnBlockedUsersLogRow)",
    "@odata.count": 1000,
    "@odata.nextLink": "https://graph.microsoft.com/beta/communications/callRecords/getPstnBlockedUsersLog(fromDateTime=2022-11-01,toDateTime=2022-12-01)?$skip=1000",
    "value": [
        {
            "userId": "76efb13c-64ba-4305-9149-4e8f854004a9",
            "userPrincipalName": "andre.lawson@contoso.com",
            "userDisplayName": "Andre Lawson",
            "blockDateTime": "2022-11-23T13:51:09.796Z",
            "userTelephoneNumber": "+37212345678",
            "userBlockMode": "Blocked",
            "blockReason": "High Overall Usage",
            "remediationId": "c98e1515-a937-4b81-b8a8-3992afde64e0",
        },
        {
            "userId": "76efb13c-64ba-4305-9149-4e8f854004a9",
            "userPrincipalName": "ruwini.perera@contoso.com",
            "userDisplayName": "Ruwini Perera",
            "blockDateTime": "2022-11-23T13:51:09.796Z",
            "userTelephoneNumber": "+37212345678",
            "userBlockMode": "Unblocked",
            "blockReason": "Tenant Requested",
            "remediationId": "c98e1515-a937-4b81-b8a8-3992afde64e0",
        }
    ]
}