Python Microsoft Store API

0
13KB

The following example demonstrates how to obtain an Azure AD access token that you can use to call methods in the Microsoft Store submission API. After you obtain a token, you have 60 minutes to use this token in calls to the Microsoft Store submission API before the token expires. After the token expires, you can generate a new token..

import http.client, json tenantId = "" # Your tenant ID clientId = "" # Your client ID clientSecret = "" # Your client secret tokenEndpoint = "https://login.microsoftonline.com/{0}/oauth2/token" tokenResource = "https://manage.devcenter.microsoft.com" tokenRequestBody = "grant_type=client_credentials&client_id={0}&client_secret={1}&resource={2}".format(clientId, clientSecret, tokenResource) headers = {"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"} tokenConnection = http.client.HTTPSConnection("login.microsoftonline.com") tokenConnection.request("POST", "/{0}/oauth2/token".format(tenantId), tokenRequestBody, headers=headers) tokenResponse = tokenConnection.getresponse() print(tokenResponse.status) tokenJson = json.loads(tokenResponse.read().decode()) print(tokenJson["access_token"]) tokenConnection.close()

Suche
Kategorien
Mehr lesen
Financial Services
The structure of costs in the long run
Key points A production technology is the specific combination of labor,...
Von Mark Lorenzo 2023-04-21 19:23:14 0 12KB
Programming
JS Error Handling
JavaScript supports a compact set of statements, specifically control flow statements, that you...
Von Jesse Thomas 2023-06-05 19:42:11 0 11KB
Personal Finance
Are Social Security Benefits Guaranteed? Political Debates and Future Solvency
Are Social Security Benefits Guaranteed? Political Debates and Future Solvency Social Security...
Von Leonard Pokrovski 2025-12-12 22:22:13 0 2KB
Personal Finance
What Is Budgeting, and Why Is It Important?
What Is Budgeting, and Why Is It Important? Introduction Money is one of the most powerful...
Von Leonard Pokrovski 2025-10-20 16:54:31 0 2KB
Business
How Can Late-Stage Startups Maintain Innovation?
As startups transition into late-stage companies, maintaining innovation becomes a challenge....
Von Dacey Rankins 2025-03-07 13:42:46 0 13KB

BigMoney.VIP Powered by Hosting Pokrov