Python Microsoft Store API

0
12KB

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
История
Харакири. Harakiri. (1962)
После распада своего клана ронин Хансиро Цугумо прибыл в поместье лорда Ии с просьбой совершить...
Von Nikolai Pokryshkin 2022-12-05 20:28:41 0 23KB
Financial Services
Types of market-oriented environmental tools
Key points The three main categories of market-oriented environmental policies are...
Von Mark Lorenzo 2023-05-03 20:55:50 0 10KB
Robotics
Robotics
Robotics is an applied science that deals with the development of automated technical...
Von Michael Pokrovski 2024-03-29 23:20:05 0 27KB
Business
What Is Coaching?
Coaching is a collaborative, forward-focused partnership designed to help individuals unlock...
Von Dacey Rankins 2025-07-21 05:32:08 0 2KB
E-Books
The Rise and Impact of E-books: Revolutionizing Reading in the Digital Age
In the digital age, e-books have transformed the way people read and interact with literature....
Von Dacey Rankins 2024-11-20 16:29:33 0 9KB

BigMoney.VIP Powered by Hosting Pokrov