Python Microsoft Store API

0
14K

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()

Search
Categories
Read More
Business
What Is a Qualified Lead?
Understanding what a qualified lead is can completely change your results in sales. Many people...
By Dacey Rankins 2025-12-15 17:39:31 0 2K
Природа и наука
Принцесса Мононоке. Princess Mononoke. (1997)
Убив вепря, юный принц Аситака навлек на себя смертельное проклятие. Старая знахарка предсказала,...
By Nikolai Pokryshkin 2023-01-03 22:51:08 0 30K
Cooking
Easy Bananas Foster Recipe !
Bananas Foster Recipe Easy IngredientsTo make this dessert you'll need: salted butterbrown...
By FWhoop Xelqua 2023-05-09 17:22:31 0 22K
Marketing and Advertising
Corporate Merch and why its needed
Corporate merchandise is a product or product that a brand or company creates and distributes...
By FWhoop Xelqua 2023-06-14 17:08:09 0 27K
Finance
What Moves Exchange Rates?
What Moves Exchange Rates? The Forces Behind Currency Fluctuations Exchange rates — the...
By Leonard Pokrovski 2025-10-16 19:13:47 0 4K

BigMoney.VIP Powered by Hosting Pokrov