Python Microsoft Store API

0
5KB

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
Nach Verein filtern
Read More
Alternative
Results of the second CAIPAN seminar from CNES
The second seminar of the French Space Agency (CNES) CAIPAN 2, held in Toulouse on October 13-14,...
Von FWhoop Xelqua 2022-12-12 15:22:20 0 11KB
Social Issues
Oldboy. (2003)
After being kidnapped and imprisoned for fifteen years, Oh Dae-Su is released, only to find that...
Von Leonard Pokrovski 2022-12-28 20:47:59 0 12KB
Социальные проблемы
Доктор Стрейнджлав, или Как я научился не волноваться и полюбил атомную бомбу. Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb. (1964)
Одержимый мыслью, что коммунисты намереваются украсть у американцев их «бесценные телесные...
Von Nikolai Pokryshkin 2022-12-24 11:18:45 0 15KB
История
Семейка Крудс: Новоселье. The Croods: A New Age. (2020)
Такие харизматичные герои как члены клана Крудс просто не в силах усидеть на месте. Они смело...
Von Nikolai Pokryshkin 2022-09-11 21:56:14 0 14KB
Issues
Problem
Problema (ancient Greek: Problema) πρόβλημα - task, task) in a...
Von FWhoop Xelqua 2023-04-19 17:27:03 0 8KB
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov