import requests
from utils import encrypt_payload, decrypt_payload  # ✅ ensure correct imports



username = 'ZVBPNPCHVMBUAQTZYOWPLTXVWXWYERDS'
password = ']soLj$si!x6IL![KP~rkQ^sXG^hT3yJS'
import requests
from utils import decrypt_payload  # If needed

# Correct URL
url = "https://send.bulkgv.net/API/v1/gettoken"

# Correct headers as per API doc
headers = {
    "Content-Type": "application/json",
    "username": username,
    "password": password
}

# ✅ Use GET (not POST)
response = requests.get(url, headers=headers)

print("🔍 Status Code:", response.status_code)
print("📦 Raw Token Response:", response.text)

# Optional: Try decrypting if response contains encrypted token
try:
    token_raw = response.json().get('data')
    token = decrypt_payload(token_raw)
    print("✅ Decrypted Token:", token)
except Exception as e:
    print("❌ Decryption failed:", e)
