Skip to content

Instantly share code, notes, and snippets.

@tocvieira
Created August 21, 2016 20:54
Show Gist options
  • Save tocvieira/ab15e70b4a7a56c0f7852e7e5ba5b697 to your computer and use it in GitHub Desktop.
Save tocvieira/ab15e70b4a7a56c0f7852e7e5ba5b697 to your computer and use it in GitHub Desktop.
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