Python Microsoft Store API

0
13K

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
Social Issues
Dear Zachary: A Letter to a Son About His Father (2008)
A filmmaker decides to memorialize a murdered friend when his friend's ex-girlfriend announces...
By Leonard Pokrovski 2023-07-03 20:42:59 0 25K
Arts, Culture and Entertainment
Some Like It Hot. (1959)
After two male musicians witness a mob hit, they flee the state in an all-female band disguised...
By Leonard Pokrovski 2023-02-05 18:34:09 0 23K
Radio
Rediscovering Recreation: The Art of Entertainment Through Radio
Rediscovering Recreation: The Art of Entertainment Through Radio In an era of dazzling visual...
By Leonard Pokrovski 2024-05-14 22:18:37 0 19K
Business
What Platforms Can I Use for Crowdfunding?
Crowdfunding has become a popular way for individuals, businesses, and organizations to raise...
By Dacey Rankins 2025-03-27 18:10:48 0 8K
Financial Services
Explicit and implicit costs and accounting and economic profit
Key points Privately owned firms are motivated to earn profits. Profit is the...
By Mark Lorenzo 2023-04-24 18:42:05 0 14K

BigMoney.VIP Powered by Hosting Pokrov