Python Microsoft Store API

0
12K

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

Căutare
Categorii
Citeste mai mult
Business
What Is Product Planning?
Product planning is one of the most essential activities in business strategy and product...
By Dacey Rankins 2025-08-20 15:37:11 0 1K
Alte
The Grand Budapest Hotel. (2014)
A writer encounters the owner of an aging high-class hotel, who tells him of his early years...
By Leonard Pokrovski 2023-03-25 20:07:07 0 25K
Спорт
Ford против Ferrari. Ford v Ferrari. (2019)
В начале 1960-х Генри Форд II принимает решение улучшить имидж компании и сменить курс на...
By Nikolai Pokryshkin 2023-04-13 22:20:33 0 40K
Arts and Entertainment
Art and Entertainment Industry
“I'm not here for your amusement. You're here for mine.”Johnny RottenArt analyzes...
By FWhoop Xelqua 2023-07-18 22:26:15 0 27K
Home
How to Make Your Home Cozier, Designer's Tips
How to Make Your Home Cozier, Designer's Tips Cozy home design is an interior decoration...
By Leonard Pokrovski 2024-04-24 16:07:48 0 15K

BigMoney.VIP Powered by Hosting Pokrov