reportRoot: getCredentialUsageSummary
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
报告组织中使用自助密码重置功能的用户数量的当前状态。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
Reports.Read.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用 |
Reports.Read.All |
HTTP 请求
GET /reports/getCredentialUsageSummary(period='{periodValue}')
函数参数
必须使用以下函数参数来请求响应的时间范围。
| 参数 |
类型 |
说明 |
| period |
字符串 |
必需。 指定需要使用情况数据的天数。 例如:/reports/getCredentialUsageSummary(period='D30')。 支持的句点: D1和 D7``D30. 句点不区分大小写。 |
可选的查询参数
此函数支持可选的 OData 查询参数 $filter。 可以对 credentialUsageSummary 资源的以下一个或多个属性应用 $filter。
| 属性 |
说明和示例 |
| 特征 |
指定要 (注册与重置) 的使用情况数据的类型。 例如:/reports/getCredentialUsageSummary(period='D30')?$filter=feature eq 'registration'。 支持的筛选器运算符: eq. |
| 名称 |
说明 |
| Authorization |
持有者 {token} |
| Content-Type |
application/json |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回 200 OK 响应代码和新的 credentialUsageSummary 集合对象。
示例
以下示例演示如何调用此 API。
请求
下面展示了示例请求。
GET https://graph.microsoft.com/beta/reports/getCredentialUsageSummary(period='D30')?$filter=feature eq 'registration'
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var getCredentialUsageSummary = await graphClient.Reports
.GetCredentialUsageSummary("D30")
.Request()
.Filter("feature eq 'registration'")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let getCredentialUsageSummary = await client.api('/reports/getCredentialUsageSummary(period='D30')')
.version('beta')
.filter('feature eq \'registration\'')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/reports/getCredentialUsageSummary(period='D30')?$filter=feature%20eq%20'registration'"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphCredentialUsageSummary *credentialUsageSummary = [[MSGraphCredentialUsageSummary alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ReportRootGetCredentialUsageSummaryCollectionPage getCredentialUsageSummary = graphClient.reports()
.getCredentialUsageSummary(ReportRootGetCredentialUsageSummaryParameterSet
.newBuilder()
.withPeriod("D30")
.build())
.buildRequest()
.filter("feature eq 'registration'")
.get();
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。 所有属性都是从实际调用返回的。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context":"https://graph.microsoft.com/beta/reports/$metadata#Collection(microsoft.graph.getCredentialUsageSummary)",
"value":[
{
"id" : "id-value",
"feature":"registration",
"successfulActivityCount":12345,
"failureActivityCount": 123,
"authMethod": "email"
}
]
}