Реклама в магазине
Banner
Почтовые сервисы

⭐️ Hotmail Accounts ⭐️ WEB Login ⭐️ OAUTH2 TOKEN ⭐️ GRAPH API

Изображение: ⭐️ Hotmail Accounts ⭐️ WEB Login ⭐️ OAUTH2 TOKEN ⭐️ GRAPH API
0 шт.
2,24 руб.
Куплено: 0 раз

На почтах доступен вход через WEB и активирован OAuth2 токен

✔ Не использованные (продажа в одни руки)
✔ OAuth2 токен активирован для Microsoft Graph API
✔ IMAP, POP3 и SMTP не включены❗
✔ Вход через WEB доступен. (Есть кнопка пропуск 7 дней)
✔ Регистрация с MIX IP
✔ Пол мужской или женский
✔ Имена и фамилии иностранные (пример: Mari Stenfort)
✔ Формат - mail;pass;refresh_token;client_id
✔ Аккаунты проверяются перед загрузкой в магазин

Для работы через OAuth2 токен используется GraphAPI вместо протокола IMAP/POP3
Документация по работе с Graph API - https://graph.microsoft.com❗

⏩Пример кода для получения писем с помощью OAuth2 GraphAPI на Python:



WEB login is available on the mail and the OAuth2 token is activated

✔ Unused (one-handed sale)
✔ OAuth2 token activated for Microsoft Graph API
✔ IMAP, POP3 and SMTP are not enabled❗
✔ Login via the WEB is available. (There is a 7-day skip button)
✔ Registration with MIX IP
✔ Gender male or female
✔ First and last names are foreign (example: Mari Stenfort)
✔ Format - mail;pass;refresh_token;client_id
✔ Accounts are checked before uploading to the store❗

To work through OAuth2, the GraphAPI token is used instead of the IMAP/POP3 protocol
Documentation on working with the Graph API - https://graph.microsoft.com

⏩Sample code for receiving emails using the OAuth2 GraphAPI in 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("Count: ", len(emails))
    
    for email in emails:
        print("   Subject:", email["subject"])
        print("   From:", email["from"]["emailAddress"]["address"])
        print("   Preview:", email["bodyPreview"])
        print("-" * 40) 

account = {
    "email": '[email protected]',
    "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)

 

Реклама в магазине
Banner