Could not get any response - Postman
I am trying the Tuto1a for user authentication under the postman tutorials collection. When I try to send I am getting the following error
Checking on the postman log the following error is found
[24720][1553500971614][requester][info]["ACService~can: No permission found for",{"model":"workspace","modelId":"29ba1c6f-43ab-4e23-8a6c-27c39a57a069","action":"CREATE_HISTORY"}]
[24720][1553500996975][requester][info]["ACService~can: No permission found for",{"model":"workspace","modelId":"29ba1c6f-43ab-4e23-8a6c-27c39a57a069","action":"CREATE_HISTORY"}]
Can you please assist?
Best Answer
-
In a nutshell (for a simple proxy without authentication):
response = requests.post(urlGetToken, tokenRequestBody, headers = header1, proxies={"https":"proxy.mydomain.com"})
For more info, see for instance this stackoverflow query, or better yet, in the requests documentation.
0
Answers
-
@KAKIT.LAI From the screenshot it looks like the Postman REST environment has not been imported, or not been selected.
Please import - TRTH REST.postman_environment.json file and select/apply it before invoking the call. You will also have to modify the dss-user and dss-password environment variables to your userID, before invoking the authorization call.
Let me know if it still doesn't work and we can try to walk you through this.
0 -
It still doesn't work. Can you walk me through this? Thanks.
0 -
@KAKIT.LAI Can you please try the instructions at - https://developers.refinitiv.com/thomson-reuters-tick-history-trth/thomson-reuters-tick-history-trth-rest-api/learning?content=8712&type=learning_material_item
It you are still having difficulty, I can post screenshots of the process.
0 -
Hi Gurpeet, it still doesnt work and the following error is seen under the postman log.
[20832][1553566585517][requester][info]["ACService~can: No permission found for",{"model":"workspace","modelId":"29ba1c6f-43ab-4e23-8a6c-27c39a57a069","action":"CREATE_HISTORY"}]
[20832][1553566616132][requester][info]["ACService~can: No permission found for",{"model":"workspace","modelId":"29ba1c6f-43ab-4e23-8a6c-27c39a57a069","action":"CREATE_HISTORY"}]We have proxy setup here and I have already define it under the setting. Having check with the network team they saw connection went out from the proxy but there is an error "SSL client handshake completion failure" observed from the proxy log. Any idea?
0 -
I manage to get it working now. Thanks.
0 -
Glad that it is working for you now. As you have identified, the parameters DSS username and password have to be entered in the Postman environment and not in the OS environment.
0 -
I am having issue retrieve the token with the following error. I suspect its because the proxy is not set.
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='hosted.datascopeapi.reuters.com', port=443): Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken (Caused by NewConnection
Error('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000000037687F0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not
properly respond after a period of time, or established connection failed because connected host has failed to respond',))The following is the python code I used. Can you advise how to pass in the proxy info to the query?
import requests, json from requests import Request, Session from collections import OrderedDict urlGetToken = 'https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken' header1 = {'Content-Type': 'application/json'} tokenRequestBody = json.dumps({'Credentials': {'Password': 'xxxxxxx', 'Username': 'xxxxxxx'}}) response = requests.post(urlGetToken, tokenRequestBody, headers = header1) statusCode = response.status_code if statusCode != 200: print('ERROR: Get Token failed with HTTP status code: ' + str(statusCode)) sys.exit(-1) else: result = response.json() token = result['value'] print(token)
0 -
@KAKIT.LAI, In addition to passing proxy information in the code as shown by Christiaan, Python "requests" can also be instructed to use proxy by enabling following command line environment variables:
set https_proxy=http://proxy:port
set http_proxy=http://proxy:port0 -
Thanks Christiaan and Gurpreet. It works but now I am getting the certificate error below. Any idea?
Traceback (most recent call last):
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 444, in wrap_socket
cnx.do_handshake()
File "C:\Anaconda3\envs\py36\lib\site-packages\OpenSSL\SSL.py", line 1907, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "C:\Anaconda3\envs\py36\lib\site-packages\OpenSSL\SSL.py", line 1639, in _raise_ssl_error
_raise_current_error()
File "C:\Anaconda3\envs\py36\lib\site-packages\OpenSSL\_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\connectionpool.py", line 594, in urlopen
self._prepare_proxy(conn)
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\connectionpool.py", line 815, in _prepare_proxy
conn.connect()
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\connection.py", line 356, in connect
ssl_context=context)
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\util\ssl_.py", line 359, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 450, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\envs\py36\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Anaconda3\envs\py36\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='hosted.datascopeapi.reuters.com', port=443): Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken (Caused by SSLError(SSLE
rror("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "REST.py", line 8, in <module>
response = requests.post(urlGetToken, tokenRequestBody, headers = header1, proxies=proxies)
File "C:\Anaconda3\envs\py36\lib\site-packages\requests\api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Anaconda3\envs\py36\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Anaconda3\envs\py36\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Anaconda3\envs\py36\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Anaconda3\envs\py36\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='hosted.datascopeapi.reuters.com', port=443): Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken (Caused by SSLError(SSLError
("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))0 -
You need to configure your code to support the DigiCert CA (both root and intermediate) which is used to sign all Refinitiv domains.
In a nutshell:
- Download DigiCert root and intermediate certificates here.
- Create a PEM file out of both certificates.
- Use it in your requests:
response = requests.post(urlGetToken, tokenRequestBody, headers = header1, proxies={"https":"proxy.mydomain.com"}, verify = 'digicert.pem')
As a test you could also disable verification, but that would make your application vulnerable to man in the middle attacks, so this is not recommended:
response = requests.post(urlGetToken, tokenRequestBody, headers = header1, proxies={"https":"proxy.mydomain.com"}, verify = false)
For detailed instructions, see this post in stackoverflow, as well as this one.
0 -
Thanks Christiaan. I downloaded both DigiCertHighAssuranceEVRootCA.crt and DigiCertHighAssuranceEVCA-1.crt. How can i create a PEM file out of both certificates? I try to cat DigiCertHighAssuranceEVCA-1.crt >> DigiCertHighAssuranceEVRootCA.crt and run the following but didnt work..
openssl x509 -in DigiCertHighAssuranceEVRootCA-new.crt -inform DER -out DigiCert.pem -outform PEM
0 -
Can you try this (taken from this post in stackoverflow):
- Cat both files together into a new file
chain.pem
. Make sure that each of the files did end with a valid end of line character (which they do not as downloaded). The resulting file should look like this.
Caveat: I'm not an expert on this, I have never done this myself as I never ran into this issue. I was hoping those 2 links would help, but maybe there is more to it.
0 - Cat both files together into a new file
-
Thanks Christiaan. You can close this ticket. I will raise a separate ticket if i have another question.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 614 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 641 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 89 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛