Python Microsoft Store API

0
15K

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
Organizations
Named top 28 largest charitable foundations in the world
The largest charitable foundations in the world are much more than just financial assistance to...
By FWhoop Xelqua 2023-01-29 14:34:06 0 27K
Personal Finance
What Is SSI and How Is It Different From SSDI?
What Is SSI and How Is It Different From SSDI? When people talk about disability benefits in the...
By Leonard Pokrovski 2025-12-11 20:05:22 0 7K
Marketing and Advertising
What is B2C Marketing? Understanding Business-to-Consumer Strategies
Business-to-Consumer (B2C) marketing refers to the strategies and tactics that businesses use to...
By Dacey Rankins 2025-09-22 15:41:04 0 13K
Productivity
Why is work-life balance important for employee retention?
Why Is Work-Life Balance Important for Employee Retention? Employee retention has become one of...
By Michael Pokrovski 2026-03-31 18:56:28 0 2K
Business
How Do Startup Founders Pay Themselves?
As a startup founder, one of the most crucial aspects of building a business is determining how...
By Dacey Rankins 2025-04-02 16:35:40 0 14K

BigMoney.VIP Powered by Hosting Pokrov