Python Microsoft Store API

0
14χλμ.

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

Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
Социальные проблемы
Поймай меня, если сможешь. Catch Me If You Can. (2002)
Фрэнк Эбегнейл успел поработать врачом, адвокатом и пилотом на пассажирской авиалинии – и...
από Nikolai Pokryshkin 2023-03-15 18:11:44 0 33χλμ.
Knots
Knots and What to know about them
There are many knots that can be useful in the mountains. But it's better to know six good ones...
από FWhoop Xelqua 2022-09-14 16:51:00 0 35χλμ.
Marketing and Advertising
Does Video Marketing Improve SEO, Search Rankings, and Website Traffic?
Introduction Search engine optimization (SEO) is at the heart of every digital marketing...
από Dacey Rankins 2025-11-13 17:20:13 0 8χλμ.
Government
Navigating the Labyrinth: Understanding the Role and Function of Government
Navigating the Labyrinth: Understanding the Role and Function of Government In the complex...
από Leonard Pokrovski 2024-06-09 11:50:40 0 22χλμ.
Business
What Key Decisions Need to Be Made—And by Whom? Clarifying Governance, Approval Processes, and Roles
Clear decision-making is a cornerstone of successful project management. Knowing what decisions...
από Dacey Rankins 2025-07-11 19:58:46 0 6χλμ.

BigMoney.VIP Powered by Hosting Pokrov