Python Microsoft Store API

0
9χλμ.

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

Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
Business
How Do Startup Founders Find Co-Founders?
Starting a new venture can be an exciting yet challenging journey. For many startup founders, one...
από Dacey Rankins 2025-04-02 16:38:36 0 5χλμ.
Business
How does passive income differ from active income?
In the world of personal finance and wealth-building, two terms that often come up are passive...
από Dacey Rankins 2025-01-16 15:34:30 0 7χλμ.
Video Games
The best video games of the XXI century
Ranked 10th TOP Bloodborne, released on the PlayStation 4 in 2015, is located. On the...
από FWhoop Xelqua 2023-01-17 17:02:41 0 15χλμ.
Social Issues
Die Hard. (1988)
A New York City police officer tries to save his estranged wife and several others taken hostage...
από Leonard Pokrovski 2023-01-31 14:35:24 0 20χλμ.
Financial Services
The structure of costs in the short run
Key points Looked at from a short-run perspective, a firm’s total costs can...
από Mark Lorenzo 2023-02-08 12:03:24 0 8χλμ.
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov