Skip to content

Commit a2e4758

Browse files
author
Wasin Waeosri
committed
add comments
1 parent f967337 commit a2e4758

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

trkd_authen.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
'''
2+
The TRKD API sample code is provided for informational purposes only
3+
and without knowledge or assumptions of the end users development environment.
4+
We offer this code to provide developers practical and useful guidance while developing their own code.
5+
However, we do not offer support and troubleshooting of issues that are related to the use of this code
6+
in a particular environment; it is offered solely as sample code for guidance.
7+
Please see the Thomson Reuters Knowledge Direct product page at http://customers.thomsonreuters.com
8+
for additional information regarding the TRKD API.'''
9+
10+
111
import os
212
import sys
313
import requests
@@ -10,10 +20,6 @@
1020
password = getpass.getpass(prompt='Please input password: ')
1121
appid = raw_input('Please input appid: ')
1222

13-
#username = 'trcsmnldauki@thomsonreuters.com'
14-
#appid = 'rkdapi'
15-
#password = 'Welcome75'
16-
1723
print '############### Sending Authentication request message to TRKD ###############'
1824

1925
##create authentication request URL, message and header
@@ -27,8 +33,10 @@
2733
if result.status_code == 200:
2834
print 'Request success'
2935
print 'response status %s'%(result.status_code)
36+
##get Token
3037
token = result.json()['CreateServiceToken_Response_1']['Token']
3138
print 'Token: %s'%(token)
39+
##get expiraion
3240
expire = result.json()['CreateServiceToken_Response_1']['Expiration']
3341
print 'Exipre: %s'%(expire)
3442
elif result.status_code == 500:

0 commit comments

Comments
 (0)