You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
572 B

import json
import requests
# REPLACE ITEMS BELOW
user='creylopez@yahoo.es'
password='h769jzYDnqpPog'
envoy_serial='122044072645'
# DO NOT CHANGE ANYTHING BELOW
data = {'user[email]': user, 'user[password]': password}
response = requests.post('https://enlighten.enphaseenergy.com/login/login.json?',data=data)
response_data = json.loads(response.text)
data = {'session_id': response_data['session_id'], 'serial_num': envoy_serial, 'username':user}
response = requests.post('https://entrez.enphaseenergy.com/tokens', json=data)
token_raw = response.text
print(token_raw)