
HOTMAILアカウント | 1ヶ月経過 | Webログイン | OAUTH2トークン | GRAPH API
Seller-provided titleMarketplace cards may show: Hotmailアカウント| 1ヶ月経過| Webログイン| Oauth2トークン| Graph Api
出品者 & 配送
| すべて | |
|---|---|
| 平均配送 | 53 分 |
| 完了率 | 99.9% |
| 紛争率 | 0.1% |
| 注文 | 1799 |
この出品者(全商品)
- 平均配送: 53 分
- 完了率: 99.9%
- 紛争率: 0.1%
- 1799件の注文に基づく
オプションを選択
注文の概要
アカウントの形式: ログイン名:パスワード:リフレッシュトークン:クライアントID。OAuth2 GraphAPI メール読み取りのPython例: import requests; def get_access_token(refresh_token, client_id): token_url = "https://login.microsoftonline.com/common/oauth2/v2.0/token"; data = { "client_id": client_id, "grant_type": "refresh_token", "refresh_token": refresh_token, "scope": "https://graph.microsoft.com/.default offline_access" }; response = requests.post(token_url, data=data); response.raise_for_status(); return response.json()["access_token"]; def read_emails(access_token): headers = { "Authorization": f"Bearer {access_token}" }; url = "https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$top=1"; response = requests.get(url, headers=headers); response.raise_for_status(); emails = response.json()["value"]; print("件数: ", len(emails)); for email in emails: print(" 件名:", email["subject"]); print(" 送信者:", email["from"]["emailAddress"]["address"]); print(" プレビュー:", email["bodyPreview"]); print("-" * 40); account = { "email": 'example@hotmail.com', "client_id": 'CLIENT_ID_HERE', "refresh_token": 'YOUR_REFRESH_TOKEN_HERE' }; access_token = get_access_token(account['refresh_token'], account['client_id']); read_emails(access_token)
