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

Search
Categories
Read More
Financial Services
Keynes’ Law and Say’s Law in the AD/AS model
Key points The short-run aggregate supply, or SRAS, curve can be divided into...
By Mark Lorenzo 2023-03-14 19:27:23 0 5K
История
Харакири. Harakiri. (1962)
После распада своего клана ронин Хансиро Цугумо прибыл в поместье лорда Ии с просьбой совершить...
By Nikolai Pokryshkin 2022-12-05 20:28:41 0 14K
Life Issues
Shutter Island. (2010)
In 1954, a U.S. Marshal investigates the disappearance of a murderer who escaped from a hospital...
By Leonard Pokrovski 2023-02-16 13:03:05 1 10K
Chemistry
Chemistry: The Science and Art of Matter
Chemistry plays a central role both due to its place among the natural and cognitive sciences,...
By FWhoop Xelqua 2023-03-21 16:32:17 0 14K
Paranormal
Unveiling the Enigma: Exploring the World of Paranormal Activities
Unveiling the Enigma: Exploring the World of Paranormal Activities Introduction: Paranormal...
By Leonard Pokrovski 2024-06-10 23:00:40 0 10K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov