Python Microsoft Store API

0
14K

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
Social Issues
Witness for the Prosecution. (1957)
A veteran British barrister must defend his client in a murder trial that has surprise after...
Por Leonard Pokrovski 2022-12-20 17:51:43 0 21K
Personal Finance
What Is FAFSA and How Do I Complete It?
What Is FAFSA and How Do I Complete It? Paying for college or career school can feel...
Por Leonard Pokrovski 2025-12-15 18:40:46 0 2K
Business
Microservices: What They Are and What Are Their Benefits
Until about 2013, companies typically developed enterprise applications as single modules with a...
Por Dacey Rankins 2024-09-26 18:26:11 0 30K
Business
What Makes Your Company Better Than Competitors?
This question invites employers to highlight their unique strengths and competitive advantages....
Por Dacey Rankins 2025-08-12 15:40:45 0 5K
Business
How Do You Assess Market Potential?
Assessing market potential is a critical step for any business or entrepreneur aiming to launch a...
Por Dacey Rankins 2025-08-19 18:04:14 0 6K

BigMoney.VIP Powered by Hosting Pokrov