Python Microsoft Store API

0
7KB

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

Rechercher
Catégories
Lire la suite
Social Issues
John Wick: Chapter 4. (2023)
John Wick uncovers a path to defeating The High Table. But before he can earn his freedom, Wick...
Par Leonard Pokrovski 2023-03-30 19:36:31 0 20KB
Walking
What is the difference between race walking and running and from ordinary walking
This is walking - but the technique of its performance is far from classical walking. It's not a...
Par FWhoop Xelqua 2022-11-04 19:06:30 0 15KB
Programming
Python Multithread
Python is an extremely famous programming language utilized for a wide variety of applications....
Par Jesse Thomas 2023-07-18 00:40:53 0 7KB
Ужасы
Время. Old. (2021)
Отправившись в отпуск на тропический остров, семья с двумя детьми решает последовать совету...
Par Nikolai Pokryshkin 2022-09-11 22:13:06 0 30KB
Financial Services
Law of Demand
Key points The law of demand states that a higher price leads to a lower...
Par Mark Lorenzo 2023-01-25 14:05:14 0 9KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov