Python Microsoft Store API

0
14KB

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

Suche
Kategorien
Mehr lesen
Business
What Role Does Personalization Play in Conversion Rate Optimization (CRO)?
In the age of abundant choices and short attention spans, customers expect experiences tailored...
Von Dacey Rankins 2025-09-10 17:36:29 0 4KB
Business
What Is Prospecting in Sales?
In sales, nothing meaningful happens until you find the right people to sell to. That first step...
Von Dacey Rankins 2025-12-08 18:28:12 0 3KB
Social Issues
A Clockwork Orange. (1971)
In the future, a sadistic gang leader is imprisoned and volunteers for a conduct-aversion...
Von Leonard Pokrovski 2023-01-20 18:37:17 0 29KB
Financial Services
Your 401(k): 10 things to find out
1. When can I start contributing? Not every 401(k) plan allows new employees to begin...
Von Mark Lorenzo 2023-05-25 18:45:54 0 12KB
Mental Health
ADHD: Genetics
ADHD has a high heritability of 74%, meaning that 74% of the presence of ADHD in the population...
Von Kelsey Rodriguez 2023-04-04 16:53:48 0 12KB

BigMoney.VIP Powered by Hosting Pokrov