Python Microsoft Store API

0
12KB

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

Rechercher
Catégories
Lire la suite
Graphics
The World of Computer Graphics: An Art and Science
Computer graphics is an interdisciplinary field that combines art, technology, and mathematics to...
Par Dacey Rankins 2024-10-10 16:40:19 0 23KB
Birding
Exploring Nature's Symphony: The Joy of Birding
Exploring Nature's Symphony: The Joy of Birding Introduction: In a world bustling with...
Par Leonard Pokrovski 2024-05-09 10:16:08 0 18KB
Business
How to Get Yourself 'Unstuck' at Work: Practical Strategies to Regain Momentum
Feeling stuck at work can be frustrating, demotivating, and even a little scary—especially...
Par Dacey Rankins 2025-05-22 20:10:30 0 6KB
Points activés
Embracing Diversity and Determination: Sports for People with Disabilities
Embracing Diversity and Determination: Sports for People with Disabilities Sports have long been...
Par Leonard Pokrovski 2024-06-20 04:13:39 0 23KB
Sécurité
Best VPNs
The essence is simple: you install a program that establishes a connection to a remote server...
Par FWhoop Xelqua 2023-05-02 20:06:53 0 15KB

BigMoney.VIP Powered by Hosting Pokrov