Python Microsoft Store API

0
15KB

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

Suche
Kategorien
Mehr lesen
Business
How Do I Determine If I’m the Right Founder for a Particular Idea?
Starting a business is a challenging yet exciting journey, and one of the most important...
Von Dacey Rankins 2025-03-24 15:42:51 0 17KB
Online Writing
133 sites that pay for articles.
If you write articles, I advise you to pay attention to websites. They pay well, while the range...
Von FWhoop Xelqua 2022-12-18 16:13:47 0 81KB
Business
What Are the Company's Core Values and Mission?
Every successful organization is built on a foundation of purpose and guiding principles. A...
Von Dacey Rankins 2025-08-05 15:08:35 0 14KB
Business
What Is a Franchise?
At some point during every long highway drive in America, the landscape begins repeating itself....
Von Dacey Rankins 2026-05-29 16:57:25 0 3KB
Coin-Op
Arcade machines: a little history of development
Now gamers, without leaving home or even looking up from their mobile device, can start computer...
Von Michael Pokrovski 2024-04-03 21:08:20 0 24KB

BigMoney.VIP Powered by Hosting Pokrov