File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 44import json
55import getpass
66
7- #Get username, password and applicationid
7+ ## Get username, password and applicationid
88username = raw_input ('Please input username: ' )
9- #use getpass.getpass to hide user inputted password
9+ ## use getpass.getpass to hide user inputted password
1010password = getpass .getpass (prompt = 'Please input password: ' )
1111appid = raw_input ('Please input appid: ' )
1212
13+ #username = 'trcsmnldauki@thomsonreuters.com'
14+ #appid = 'rkdapi'
15+ #password = 'Welcome75'
16+
1317print '############### Sending Authentication request message to TRKD ###############'
1418
15- #create authentication request URL, message and header
19+ ## create authentication request URL, message and header
1620authenMsg = {'CreateServiceToken_Request_1' : { 'ApplicationID' :appid , 'Username' :username ,'Password' :password }}
1721authenURL = 'https://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1'
1822headers = {'content-type' : 'application/json;charset=utf-8' }
1923
2024try :
21- #send request
25+ ## send request
2226 result = requests .post (authenURL , data = json .dumps (authenMsg ), headers = headers )
2327 if result .status_code == 200 :
2428 print 'Request success'
3236 print 'response status %s' % (result .status_code )
3337 print 'Error: %s' % (result .json ())
3438except requests .exceptions .RequestException as e :
39+ print 'Exception!!!'
3540 print e
3641 sys .exit (1 )
3742
You can’t perform that action at this time.
0 commit comments