Python Microsoft Store API

0
5K

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

Buscar
Categorías
Read More
Agriculture and Forestry
Business in Agriculture and Forestry: A Growing Sector
Introduction Agriculture and forestry are vital components of the global economy, providing...
By Dacey Rankins 2024-10-17 17:09:58 0 16K
Periods and Movements
Art periods
As long as we humans can use our hands, we create art. From the early cave paintings to the...
By FWhoop Xelqua 2023-07-11 18:46:08 0 16K
Mental Health
Schizophrenia - Other
OtherExercise including aerobic exercise has been shown to improve positive and negative...
By Kelsey Rodriguez 2023-02-09 15:55:55 0 5K
Financial Services
How to establish an emergency savings fund
Establishing an emergency savings fund now can have a big payoff later. Setting aside emergency...
By Mark Lorenzo 2023-05-17 20:13:55 0 8K
Construction and Maintenance
The Importance of Construction and Maintenance in Modern Infrastructure
Construction and maintenance are two fundamental pillars that ensure the functionality, safety,...
By Dacey Rankins 2024-11-14 15:59:39 0 3K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov