Getting started
Use the Hardware Partner Analytics API to programmatically retrieve analytics data for devices. This API uses Azure Active Directory (Azure AD) to authenticate the calls from your app or service.
The following steps describe the end-to-end process:
Make sure that you have completed all the prerequisites.
Before you call a method in the Hardware Partner Analytics API, obtain an Azure AD access token. After you obtain a token, you have 60 minutes to use this token in calls to the Hardware Partner Analytics API before the token expires. After the token expires, you can generate a new token.
Call the Hardware Partner Analytics API.
Step 1: Complete prerequisites for using the Hardware Partner Analytics API
Before you start writing code to call the Hardware Partner Analytics API, make sure that you have completed the following prerequisites.
You (or your organization) must have an Azure AD directory and you must have Global administrator permission for the directory. If you already use Office 365 or other business services from Microsoft, you already have Azure AD directory. Otherwise, you can create a new Azure AD in Dev Center for no additional charge.
You must associate an Azure AD application with your Dev Center account, retrieve the tenant ID and client ID for the application and generate a key. The Azure AD application represents the app or service from which you want to call the Hardware Partner Analytics API. You need the tenant ID, client ID and key to obtain an Azure AD access token that you pass to the API.
You only need to perform this task one time. After you have the tenant ID, client ID and key, you can reuse them any time you need to create a new Azure AD access token.
To associate an Azure AD application with your Dev Center account and retrieve the required values:
In Partner Center, go to your Account settings, click Manage users, and associate your organization's Partner Center account with your organization's Azure AD directory .
In the Manage users page, click Add Azure AD applications, add the Azure AD application that represents the app or service that you will use to access analytics data for your Dev Center account, and assign it the Manager role. If this application already exists in your Azure AD directory, you can select it on the Add Azure AD applications page to add it to your Dev Center account. Otherwise, you can create a new Azure AD application on the Add Azure AD applications page. For more information, see Add Azure AD applications to your Dev Center account .
Return to the Manage users page, click the name of your Azure AD application to go to the application settings, and copy down the Tenant ID and Client ID values.
Click Add new key. On the following screen, copy down the Key value. You won't be able to access this info again after you leave this page. For more information, see Manage keys for an Azure AD application .
Step 2: Obtain an Azure AD access token
Before you call any of the methods in the Hardware Partner Analytics API, you must first obtain an Azure AD access token that you pass to the Authorization header of each method in the API. After you obtain an access token, you have 60 minutes to use it before it expires. After the token expires, you can refresh the token so you can continue to use it in further calls to the API. To obtain the access token, follow the instructions in Service to Service Calls Using Client Credentials to send an HTTP POST to the https://login.microsoftonline.com/<tenant_id>/oauth2/token endpoint. Here is a sample request:
POST https://login.microsoftonline.com/<tenant_id>/oauth2/token HTTP/1.1
Host: login.microsoftonline.com Content-Type: application/x-www-form-urlencoded; charset=utf-8
grant_type=client_credentials
&client_id=<your_client_id>
&client_secret=<your_client_secret>
&resource=https://manage.devcenter.microsoft.com
For the tenant_id value in the POST URI and the client_id and client_secret parameters, specify the tenant ID, client ID and the key for your application that you retrieved from Dev Center in the previous section. For the resource parameter, you must specify https://manage.devcenter.microsoft.com. After your access token expires, you can refresh it by following the instructions here.
Step 3: Start using an API
After you have an Azure AD access token, you are ready to call the Hardware Partner Analytics APIs. Check out the automatically generated API Documentation that describes how to use the APIs and includes code samples in multiple languages. The API Console allows you to directly interact with the API right here in the developer portal.
Please make sure to allow access to our API endpoint (https://partneranalyticsapim.microsoft.com/) and verify that no firewall is blocking communication with it.
Tabular APIs: Available datasets
These are the datasets currently available for query via the tabular APIs: dataset list.
Sample queries are provided for each dataset.