Python Microsoft Store API

0
10K

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
Living History
Living History Recreation: Bringing the Past to Life Through Timeless Experience
Living History Recreation: Bringing the Past to Life Through Timeless Experience In the vast...
Por Leonard Pokrovski 2024-05-14 23:29:07 0 16K
Business
Why is Business Strategy Important? Understanding the Role of Strategy in Achieving Business Goals
Business strategy is not just a buzzword; it’s the foundation of any successful business. A...
Por Dacey Rankins 2024-12-23 16:02:49 0 7K
Mental Health
Dementia: Signs and Symptoms
The signs and symptoms of dementia are termed as the neuropsychiatric symptoms, also known as the...
Por Kelsey Rodriguez 2023-07-13 20:01:00 0 10K
Personal Finance
How to learn to spend money on yourself
Spending money on yourself without regrets, anxiety and guilt is an art that is not inherent in...
Por Dacey Rankins 2024-10-28 19:10:04 0 9K
Business
What daily habits do successful founders have?
Success in the startup world rarely happens by accident. Behind every thriving founder is a set...
Por Dacey Rankins 2025-04-14 13:37:20 0 5K
image/svg+xml


BigMoney.VIP Powered by Hosting Pokrov