Graph for Hotmail and Outlook: How to Receive Emails with OAuth 2.0

Published Jun 23, 20260 min readUpdated Jun 23, 2026View Count 4

This article explains how to receive Hotmail/Outlook emails using Microsoft Graph (OAuth2.0) and how Refresh Token and Client ID work in Graph email retrieval. Hotmail007 provides email accounts with token information, allowing users to quickly get the latest email through the API documentation or connect to Microsoft Graph with Python sample code. This guide is suitable for users who need bulk purchasing Hotmail accounts, Outlook accounts wholesale, verification email retrieval, and automated email receiving.

Microsoft Graph (OAuth2.0) is a mainstream email data access method officially provided by Microsoft. It can be used to read email content from Microsoft email accounts such as Hotmail and Outlook. Compared with traditional email protocols, Graph API is more suitable for verification email retrieval, automated email receiving, bulk account management, and system integration. It also provides fast email retrieval performance.

All Hotmail/Outlook email accounts provided by Hotmail007 include Refresh Token and Client ID, which can be used for Graph (OAuth2.0) email retrieval. If you need bulk purchasing Hotmail accounts, Hotmail accounts wholesale, Outlook accounts wholesale, or Microsoft email accounts that support Graph, you can choose Hotmail007 API for quick email retrieval or connect to Microsoft Graph directly according to your usage needs.

In This Article

  1. What is Microsoft Graph (OAuth2.0) email retrieval?

  2. Why does Graph email retrieval require Refresh Token and Client ID?

  3. Use Hotmail007 API to quickly get the latest email

  4. Connect to Microsoft Graph directly to read emails

  5. How to choose between the two email retrieval methods

  6. Notes for using Graph email retrieval

1. What is Microsoft Graph (OAuth2.0) Email Retrieval?

Microsoft Graph is an official Microsoft API that can be used to access Outlook emails, contacts, calendars, and other Microsoft account data.

In Hotmail/Outlook email retrieval, Graph (OAuth2.0) reads mailbox data through authorization information instead of relying only on traditional email protocols. Simply put, many older email retrieval methods mainly use an email address and password to connect to the mail server. Graph requires Refresh Token and Client ID to complete authorization before reading emails.

It is suitable for verification email retrieval, automated email receiving, bulk Hotmail/Outlook account management, and integrating mailbox retrieval into your own system.

If users use a third-party email receiving tool, they usually need to fill in the email address, password, Refresh Token, Client ID, and other required information according to the tool’s instructions.

2. Why Does Graph Email Retrieval Require Refresh Token and Client ID?

Graph (OAuth2.0) uses an authorization mechanism to read emails. For Hotmail/Outlook Graph email retrieval, Refresh Token and Client ID are very important fields.

  • Refresh Token: used to maintain authorization and obtain access permission

  • Client ID: used to identify the corresponding authorized application

  • Access Token: temporarily obtained during the request process, and ordinary users usually do not need to enter it manually

All Hotmail/Outlook email accounts provided by Hotmail007 include Refresh Token and Client ID. The common delivery format is:

email:password:refreshToken:clientId

This format can be used to get the latest email through Hotmail007 API, third-party email receiving tools, or custom code connected to Microsoft Graph.

Please note that Refresh Token is usually valid for about 3 months from creation, depending on the actual authorization status of the account. If the Token expires or becomes invalid, you need to replace it with a valid Token or obtain new authorization information.

Some users may experience request issues caused by network environment or IP status during actual use. If Graph email retrieval fails, you can first check the Refresh Token, Client ID, account format, request parameters, and network environment.

3. Use Hotmail007 API to Quickly Get the Latest Email

Hotmail007 API is suitable for quickly retrieving the latest email from a specified Hotmail/Outlook mailbox. Users can fill in parameters on the API documentation page and copy the generated request link, or integrate the API into a program for batch calls.

API documentation:

https://hotmail007.com/api-docs

After entering the API documentation, find:

04 Get the latest email of the specified email account

This API retrieves the latest email from a specified email account using account information, mailbox folder, and an optional timestamp.

API endpoint:

https://gapi.hotmail007.com/open/mail/latest

Request parameters:

  • clientKey: your API Key

  • account: full email account credentials in email:password:refreshToken:clientId format

  • folder: mailbox folder, only inbox or junkemail is supported. inbox retrieves the latest email from the inbox, and junkemail retrieves the latest email from the junk folder

  • start_timestamp: optional, returns only emails received after the specified Unix timestamp in seconds

3.1 Generate a Request Link from the API Documentation Page

For users who are not familiar with programming, the test interface in the API documentation can be used directly.

After filling in clientKey, account, and folder in the test interface, the page will automatically generate a request example. Copy the generated request link and open it in a browser to view the latest email.

This method is suitable for temporarily checking emails, reading verification emails, or quickly testing whether a Hotmail/Outlook mailbox can receive emails normally.


3.2 Call the API Through a Program

If you need to retrieve the latest emails in bulk, you can integrate the Hotmail007 API into your script or system.

Python example:

import requests

clientKey = "your_clientKey"
account = "email:password:refreshToken:clientId"
folder = "inbox"

url = "https://gapi.hotmail007.com/open/mail/latest"

resp = requests.get(
    url,
    params={
        "clientKey": clientKey,
        "account": account,
        "folder": folder
    }
)

print(resp.text)

If you need to filter emails by time, add start_timestamp:

import requests

clientKey = "your_clientKey"
account = "email:password:refreshToken:clientId"
folder = "inbox"
start_timestamp = 1710000000

url = "https://gapi.hotmail007.com/open/mail/latest"

resp = requests.get(
    url,
    params={
        "clientKey": clientKey,
        "account": account,
        "folder": folder,
        "start_timestamp": start_timestamp
    }
)

print(resp.text)

This method is suitable for verification email retrieval, platform registration email receiving, bulk Hotmail email retrieval, and Outlook email automation.


4. Connect to Microsoft Graph Directly to Read Emails

If you want to connect directly to the official Microsoft Graph API, you can use the Refresh Token and Client ID from the full account format to complete the authorization request and then read Outlook inbox emails. Compared with Hotmail007 API, which is mainly used to quickly get the latest email, direct Microsoft Graph integration is more suitable for scenarios that require accessing multiple emails, filtering email lists, or processing more email content.

Basic process:

  1. Prepare the full account format: email:password:refreshToken:clientId

  2. Read the Refresh Token and Client ID from the account information

  3. Obtain temporary access permission through the OAuth2.0 endpoint

  4. Call the Microsoft Graph mail API to read inbox emails

Python example:

import requests


def get_access_token(refresh_token: str, client_id: str) -> str:
    res = requests.post(
        "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"
        }
    )
    res.raise_for_status()
    return res.json()["access_token"]


def print_inbox(access_token: str) -> None:
    res = requests.get(
        "https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages",
        headers={"Authorization": f"Bearer {access_token}"}
    )
    res.raise_for_status()

    for mail in res.json().get("value", []):
        print(f"Subject: {mail.get('subject')}")
        print(f"From: {mail.get('from', {}).get('emailAddress', {}).get('address')}")
        print(f"Text: {mail.get('bodyPreview')}")
        print("-" * 50)


account = "email:password:refreshToken:clientId"

parts = account.split(":")
refresh_token = parts[2]
client_id = parts[3]

access_token = get_access_token(refresh_token, client_id)
print_inbox(access_token)


5. How to Choose Between the Two Email Retrieval Methods

If you only want to quickly view the latest email from a Hotmail/Outlook mailbox, you can use the Test Interface in the Hotmail007 API documentation. After filling in the parameters, copy the generated Request Example and open it in a browser.

If you need to retrieve the latest emails in bulk, you can call Hotmail007 API directly and integrate it into your script or system.

If you need more flexible email processing, such as reading multiple emails, filtering emails, or parsing email body content, you can connect to Microsoft Graph directly.

In short:

  • Quickly view the latest email: use the Hotmail007 API Test Interface

  • Retrieve latest emails in bulk: call Hotmail007 API

  • Customize email processing logic: connect to Microsoft Graph

6. Notes for Using Graph Email Retrieval

When using Microsoft Graph (OAuth2.0) or Hotmail007 API to retrieve emails, it is recommended to check the following information:

  • Whether the account format is email:password:refreshToken:clientId

  • Whether the Refresh Token is still valid

  • Whether the Client ID is correct

  • Whether folder is set to inbox or junkemail

  • Whether clientKey is correct

  • Whether the request parameters are complete

  • Whether the network environment is stable

Refresh Token is usually valid for about 3 months from creation, depending on the actual authorization status of the account. To keep Hotmail/Outlook email retrieval stable, it is recommended to check the Token status regularly.

Conclusion

Microsoft Graph (OAuth2.0) is now a mainstream API email retrieval method for Hotmail/Outlook mailboxes. It is suitable for fast email receiving, verification email retrieval, automated email processing, and bulk mailbox management.

All Hotmail/Outlook accounts provided by Hotmail007 include Refresh Token and Client ID. The common delivery format is email:password:refreshToken:clientId. Users can quickly get the latest email through Hotmail007 API or connect to Microsoft Graph directly using Refresh Token and Client ID.

If you need bulk purchasing Hotmail accounts, Hotmail accounts wholesale, Outlook accounts wholesale, or Microsoft email accounts that support Graph (OAuth2.0), Hotmail007 can provide account and API support.

Related Tutorials

Was this guide helpful?

Back to All Tutorials

Start Your Professional Trial

Hotmail007 offers low prices and excellent service for purchasing Hotmail and Outlook accounts. Bulk purchases are even cheaper. Choose from a variety of account types to suit your workflow.

H
Hotmail007

Welcome to Hotmail007! We offer low prices and excellent service for purchasing Hotmail and Outlook accounts. Bulk purchases are even cheaper. Choose from a variety of Hotmail and Outlook email types to suit your needs.

©2026 - copyright