For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
3 0 0 2

Error: Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken

I am getting the below error while trying to get token from DSS REST API, Even after using verify = False , I am getting the same error

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='hosted.datascopeapi.reuters.com', port=443): Max retries exceeded with url: /RestApi/v1/Authentication/RequestToken (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f29d510f820>: Failed to establish a new connection: [Errno -2] Name or service not known'))


Code Used:

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': '*****', 'Username': '*******'}})
response = requests.post(urlGetToken, tokenRequestBody, headers = header1, verify=False)
statusCode = response.status_code
if statusCode != 200:
print('ERROR: Get Token failed with HTTP status code: ' + str(statusCode))

else:
result = response.json()
token = result['value']
print(token)

dss-rest-apidatascope-selectdssauthenticationextractionurl
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
28.3k 30 11 15

Hello @prakash.balusamy,

Looks like you are not reaching DSS endpoint.

Usually, this happens when one is running from behind a firewall and requires to use a proxy to connect.

You may find this discussion to be relevant.

You may be using proxy settings in other applications connecting to external destinations from the same machine, allowing you to reuse the same settings. Or may need to find out the appropriate proxy settings from your organization's network admin/group.

Let us know how this suggestion works for you, if you are able to make progress.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Now I can able to get access the DSS URL, whom do I need to check to get permission for template as below?

10:19:30=== Exception occrued: Error: Status Code:403 Message:{"error":{"message":"No permission for template \"IntradayPricingReportTemplate\"."}}

Upvotes
14.7k 39 12 18

@prakash.balusamy, are you able to reach the DSS website - https://hosted.datascopeapi.reuters.com/DatascopeApi in the browser. If yes, you can check the browser settings to see if it is configured to use proxy server.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.