python, windows, rest api
How do I bypass this error?
@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 requestsurl = "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=payloadprint ('POST /session Token', r.status_code, r.reason)