我的英语不是最好的,但是我还是会尝试的。
我正在处理Azure Function .Net项目,并需要PowerBI Rest Apis以获取终结点的管理员数据api.powerbi.com/v1.0/myorg/admin/activityevents。问题是此端点和PowerShell对应对象之间缺少属性。
PowerShell模型
{
"Id": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"RecordType": 20,
"CreationTime": "2020-03-24T23:00:14Z",
"Operation": "ViewReport",
"OrganizationId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"UserType": 0,
"UserKey": "KKKKKKKKKKKKKKK",
"Workload": "PowerBI",
"UserId": "[email protected]",
"ClientIP": "190.196.218.34",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
"Activity": "ViewReport",
"ItemName": "Asignaciones",
"WorkSpaceName": "Asignaciones",
"DatasetName": "Asignaciones",
"ReportName": "Asignaciones",
"WorkspaceId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"AppName": "Asignaciones",
"ObjectId": "Asignaciones",
"DatasetId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"ReportId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx,
"IsSuccess": true,
"ReportType": "PowerBIReport",
"RequestId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"ActivityId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"AppReportId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"DistributionMethod": "Apps"
}
PowerBI RestAPI网址:示例https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime='2020-03-31T23:00:00.000'&endDateTime ='2020-03-31T23:59:59.999'
{
"Id": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"RecordType": 20,
"CreationTime": "2020-03-31T00:30:11",
"Operation": "GenerateCustomVisualAADAccessToken",
"OrganizationId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"UserType": 0,
"UserKey": "KKKKKKKKKKKKKKKK",
"Workload": "PowerBI",
"UserId": "[email protected]",
"ClientIP": "000.000.000.00",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko",
"Activity": "GenerateCustomVisualAADAccessToken",
"IsSuccess": true,
"RequestId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"ActivityId": "xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"CustomVisualAccessTokenResourceId": "PowerQuery_PBI_xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxx",
"CustomVisualAccessTokenSiteUri": "https://powerquery.microsoft.com"
},
如您所见,属性之间不匹配。问题是我需要知道ActivityEvent来自哪个报告,仪表板。
我知道这个api有很多局限性,文档没有太大帮助。如果您知道如何以其他方式实现此目标,请告诉我。
谢谢。
已解决,
因此,此端点返回一个对象列表,该对象列表可能会根据其返回的事件类型而发生变化,因此“ ViewReport”和“ ViewDashboards”将返回此模型。
{
"Id": "ca56a114-acae-447d-b815-dc6d82d5d75c",
"RecordType": 20,
"CreationTime": "2020-03-31T11:39:25",
"Operation": "ViewReport",
"OrganizationId": "49876daa-69a7-40a0-9395-e48ec4021554",
"UserType": 0,
"UserKey": "10037FFEACCAF143",
"Workload": "PowerBI",
"UserId": "[email protected]",
"ClientIP": "201.215.93.34",
"UserAgent": "okhttp/4.2.2",
"Activity": "ViewReport",
"ItemName": "Colbun_Presentación_v3",
"WorkSpaceName": "COLBUN_PERU",
"DatasetName": "Colbun_Presentación_v3",
"ReportName": "Colbun_Presentación_v3",
"WorkspaceId": "0bd8f723-27ff-4638-a161-7bc8cda4c5da",
"ObjectId": "Colbun_Presentación_v3",
"DatasetId": "db1ffc31-bea6-4aae-9081-581898c8abce",
"ReportId": "b96353c3-2309-4f18-bbaf-087a60ae97b0",
"IsSuccess": true,
"ReportType": "PowerBIReport",
"RequestId": "7d9ebcef-b4c1-4350-92c6-6af24f66ea87",
"ActivityId": "00000000-0000-0000-0000-000000000000",
"DistributionMethod": "Workspace",
"ConsumptionMethod": "Power BI Mobile"
},
我从未见过这个,因为Api的另一个问题。还是谢谢你。