Python Microsoft Store API

0
14K

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

Pesquisar
Categorias
Leia Mais
Mental Health
ADHD: Environment
In addition to genetics, some environmental factors might play a role in causing ADHD. Alcohol...
Por Kelsey Rodriguez 2023-04-06 18:00:36 0 13K
Business
What Challenges Do Creators Face?
The Creator Economy has opened up countless opportunities for individuals to share their...
Por Dacey Rankins 2025-02-24 16:02:51 0 11K
Business and Corporate Finance
How Do Businesses Reduce Costs Legally?
How Do Businesses Reduce Costs Legally? Expense Management and Efficiency Strategies Reducing...
Por Leonard Pokrovski 2026-01-07 07:30:05 0 3K
Телевидение
12 Омское областное телевидение. Прямой эфир.
12 канал — единственная региональная телекомпания, осуществляющая собственное...
Por Nikolai Pokryshkin 2022-10-07 18:24:16 0 44K
Financial Services
How perfectly competitive firms make output decisions
Key points As a perfectly competitive firm produces a greater quantity of output,...
Por Mark Lorenzo 2023-04-26 17:47:49 0 12K

BigMoney.VIP Powered by Hosting Pokrov