Python Microsoft Store API

0
9K

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
Top 3 Mistakes in Presenting Your Product
Let's figure out what not to do to find and get your business angel. Let's list the most common...
By Dacey Rankins 2024-09-13 14:21:50 0 9K
Social Issues
American History X (1998)
A former neo-nazi skinhead tries to prevent his younger brother from going down the same wrong...
By Leonard Pokrovski 2022-11-30 20:32:51 0 22K
Personal Organization
Social work
Social work with the elderly in the UNITED STATES In the United States, the implementation of...
By FWhoop Xelqua 2023-01-21 17:55:34 0 18K
Life Issues
To Kill a Mockingbird. (1962)
Atticus Finch, a widowed lawyer in Depression-era Alabama, defends a black man against an...
By Leonard Pokrovski 2023-01-24 14:39:42 0 16K
Business
How Do I Measure Progress in a Lean Startup?
In a Lean Startup, progress isn’t measured by traditional business metrics like total...
By Dacey Rankins 2025-03-10 17:30:00 0 5K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov