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
Marketing and Advertising
What Is the “Do Not Call” Registry and How Does It Work? Understanding Your Rights and Business Obligations
Introduction Telemarketing can be an effective channel for businesses, but it has also been one...
Von Dacey Rankins 2025-11-05 14:49:09 0 6KB
Научная фантастика и фэнтези
ВАЛЛ-И. WALL·E (2008)
Робот ВАЛЛ·И из года в год прилежно трудится на опустевшей Земле, очищая нашу планету от...
Von Nikolai Pokryshkin 2022-12-14 10:18:15 0 43KB
Financial Services
Market equilibrium
Key points Supply and demand curves intersect at the equilibrium price. This is the...
Von Mark Lorenzo 2023-02-10 14:23:05 0 18KB
Asia
Asia - Tourist Guide
Asia Asia is very different – beautiful, bright, traditional and shocking....
Von FWhoop Xelqua 2023-01-24 15:19:37 0 42KB
Internet Broadcasts
The Rise of Internet Broadcasts: Transforming Media and Communication
The internet has revolutionized the way we communicate, access information, and entertain...
Von Dacey Rankins 2024-12-09 14:04:38 0 12KB

BigMoney.VIP Powered by Hosting Pokrov