Python Microsoft Store API

0
12K

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
Categories
Read More
Opportunities
Top 20 Most Important Questions for Business
Top 20 Most Important Questions for Business   An entrepreneur should answer...
By Leonard Pokrovski 2024-03-15 19:28:54 0 31K
Business
What’s the Product Management Career Path and Qualifications?
Product management has emerged as one of the most dynamic and in-demand career paths in the...
By Dacey Rankins 2025-08-18 13:26:02 0 2K
Социальные проблемы
Мадам Клод. Madame Claude. (2021)
Париж, 1960-е. Мадам Клод возглавляет процветающий бизнес, связанный с проституцией, который дает...
By Nikolai Pokryshkin 2022-09-12 22:15:57 0 27K
Business
How Did They Climb to the Top—Career Path and Pivotal Roles?
Every leader’s journey to the top is unique, but most share common themes of persistence,...
By Dacey Rankins 2025-08-14 21:37:01 0 2K
Other
FYRE: The Greatest Party That Never Happened. (2019)
An exclusive behind the scenes look at the infamous unraveling of the Fyre music festival. My...
By Leonard Pokrovski 2023-06-04 19:53:08 0 28K

BigMoney.VIP Powered by Hosting Pokrov