Python Microsoft Store API

0
7K

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

Site içinde arama yapın
Kategoriler
Read More
Sport
The King of Kong: A Fistful of Quarters (2007)
Die-hard gamers compete to break world records on classic arcade games. My Link
By Leonard Pokrovski 2 yıl önce 0 20K
Business
How Can I Improve the Production Quality of My Content?
In today’s digital landscape, content creators are under pressure to produce high-quality...
By Dacey Rankins bir ay önce 0 3K
Music
The Power of Music: A Universal Language of Emotion and Expression
Music has been a cornerstone of human culture for millennia, transcending borders, languages, and...
By Dacey Rankins 4 ay önce 0 3K
Graphics
Neural networks for the designer: the best services with AI to simplify the work
Neural networks are a powerful tool that can help designers improve the efficiency and quality of...
By FWhoop Xelqua 2 yıl önce 0 25K
Business
What is a Business Consultant?
In today’s competitive business environment, organizations often seek external expertise to...
By Dacey Rankins 2 ay önce 0 6K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov

Top sites Pokrov