#NEWLINE# def __init__( self , app_id , app_token , key , secret , domain ) : #NEWLINE# #INDENT# body = { #NEWLINE# #INDENT# 'grant_type' : 'app' , #NEWLINE# 'client_id' : key , #NEWLINE# 'client_secret' : secret , #NEWLINE# 'app_id' : app_id , #NEWLINE# 'app_token' : app_token , #NEWLINE# #UNINDENT# } #NEWLINE# h = Http ( disable_ssl_certificate_validation = True ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'content-type' : 'application/x-www-form-urlencoded' , #NEWLINE# #UNINDENT# } #NEWLINE# ( response , data ) = h . request ( ( domain + '/oauth/token' ) , 'POST' , urlencode ( body ) , headers = headers ) #NEWLINE# self . token = OAuthToken ( _handle_response ( response , data ) )