Created
August 21, 2016 20:54
-
-
Save tocvieira/ab15e70b4a7a56c0f7852e7e5ba5b697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from urllib.request import Request, urlopen | |
import json | |
def login_stone(): | |
today = datetime.datetime.strftime(datetime.datetime.now(), '%Y%m%d') | |
url = 'https://conciliation.stone.com.br/conciliation-file/v2/{}'.format(today) | |
headers = { | |
"Authorization": 'cabab2f481f34f50920726f1aded858a', #Chave de teste | |
"Accept-Encoding": "gzip" | |
} | |
request = Request(url, headers=headers) | |
response_body = urlopen(request).read().decode('utf-8') | |
response_dict = json.loads(response_body) | |
return response_dict | |
print (login_stone()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment