Python Microsoft Store API

0
13K

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

Pesquisar
Categorias
Leia Mais
Writers Resources
Top 9 Useful Writing sites
Your creative process as a science fiction writer may be different from that of your peers, but...
Por FWhoop Xelqua 2023-07-14 18:00:30 0 23K
Fantasy
Fantasy Sports: Where Strategy Meets Passion
Fantasy Sports: Where Strategy Meets Passion Fantasy sports have revolutionized the way millions...
Por Leonard Pokrovski 2024-06-22 02:41:08 0 21K
Жизненные вопросы
Красота по-американски. American Beauty. (1999)
Лестер Бернэм переживает кризис среднего возраста. Его не уважают и не ценят на работе, а от...
Por Nikolai Pokryshkin 2022-12-23 11:50:19 0 29K
Marketing and Advertising
YouTube Marketing – Key Questions, Strategies & Best Practices
Introduction YouTube is no longer just a video-sharing platform—it’s a search...
Por Dacey Rankins 2025-11-14 20:51:09 0 2K
Научная фантастика и фэнтези
Парк Юрского периода - Антология. Jurassic Park - Anthology. (1993-2022) Все фильмы.
Парк юрского периода. (1993)Глава компании «Ин-Ген», профессор Джон Хаммонд, находит...
Por Nikolai Pokryshkin 2023-02-17 12:46:05 0 28K

BigMoney.VIP Powered by Hosting Pokrov