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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 1 1

POST /session Token 500 Internal Server Error

python, windows, rest api

screenshot-2023-01-26-125223.png


How do I bypass this error?

python#technologydss-rest-api#producterror-500
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.

1 Answer

· Write an Answer
Upvote
Accepted
406 6 2 6

@mcopeland Hi, please could you try the below, replacing the <Your password> with your password this should obtain a 200 OK then the Token is found in the "value" key in the response:

import requests

url = "https://selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/RequestToken"

payload = "{\r\n    \"Credentials\": {\r\n        \"Username\":  \"9033378\",\r\n        \"Password\":  \"<Your password>\"\r\n    }\r\n}"
headers = {
  'Prefer': 'respond-async',
  'Content-Type': 'application/json; odata=minimalmetadata'
}

r = requests.request("POST", url, headers=headers, data=payload

print ('POST /session Token', r.status_code, r.reason)
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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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