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
Play Groups
The Power of Gameplay Groups: Building Community and Enhancing the Gaming Experience
Gaming has evolved far beyond being a solitary activity; it’s now a social, interactive...
Von Dacey Rankins 2024-11-27 14:16:14 0 12KB
Programming
Differences Between For Loop And forEach Loop in JavaScript
for loop forEach loop Generic type of loop and can be used in a variety of scenarios....
Von Jesse Thomas 2023-05-29 20:48:24 0 12KB
Business
Why Do You Want to Work Here? Understanding a Candidate’s Motivation and Alignment
The question "Why do you want to work here?" is a staple in job interviews. It may sound simple,...
Von Dacey Rankins 2025-06-25 12:41:52 0 7KB
Marketing and Advertising
What Are the Best AdSense Alternatives?
Google AdSense is often the first monetization method publishers use—but it is not always...
Von Dacey Rankins 2025-12-26 18:22:14 0 4KB
Customer Service
How Do Companies Improve Customer Service?
Customer service plays a critical role in how businesses build relationships with their...
Von Dacey Rankins 2026-03-10 20:28:29 0 4KB

BigMoney.VIP Powered by Hosting Pokrov