能否通过Microsoft Graph API获取Skype for Business设备使用分布用户数的JSON数据?
Great question! Let's break down what's possible here:
Direct JSON support for this specific report endpoint: Unfortunately, no. The
getSkypeForBusinessDeviceUsageDistributionUserCountsAPI is explicitly designed to return a CSV-formatted report, and there’s no built-in parameter or alternative endpoint that returns the same aggregated device usage user count data in JSON format directly.Workaround 1: Convert CSV to JSON post-retrieval
This is the most straightforward solution. Once you fetch the CSV content from the API, you can parse and convert it to JSON using your preferred programming language’s tools:- In Python: Use libraries like
pandas(withpd.read_csv()followed by.to_json()) or the built-incsvmodule to map rows to dictionaries. - In JavaScript: Use packages like
csv-parseror client-sideFileReaderlogic to process the CSV string into JSON objects.
- In Python: Use libraries like
Workaround 2: Aggregate raw data via other Graph endpoints
If you want to avoid CSV parsing entirely, you can explore lower-level Graph API endpoints that expose raw device usage data, then aggregate it yourself to match the report’s metrics. For example, endpoints related to user communication activity (call/meeting usage details) may include device information. Note this requires appropriate permissions (typicallyReports.Read.Allor similar), and you’ll need to build your own logic to count unique users per device type.Feedback for Microsoft
If JSON support for this report is critical to your workflow, consider submitting feedback to the Microsoft Graph product team—user-requested features often get prioritized for future updates.
内容的提问来源于stack exchange,提问作者user9673724

