Here is the part of code that calls the endpoint (to get a glimpse of headers, method etc.):
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.refinitiv.com:443/auth/oauth2/v1/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.field("grant_type", "password")
.field("username", "***************")
.field("password", "***************")
.field("takeExclusiveSignOnControl", "True")
.field("scope", "trapi")
.field("client_id", "********************")
.asString();
Here’s what I get from server:
Response body:
{"error":"access_denied" }
HTTP status: 400
Headers:
Date Tue, 30 Jun 2020 14:24:59 GMT
Content-Type application/json
Content-Length 29
Connection keep-alive
X-Amzn-Trace-Id Root=1-5efb4b3b-4a278e16d28720ec9826d572
X-Served-By region=eu-west-1; cid=9b0a08d5-13b9-4b70-bc36-90e6c60e0089
X-Tr-Requestid 52ddba1d-31a4-4b9f-bc55-30d1834d5c81
Credentials are ok, because if I change them to the wrong ones - I get different message.
I've tried sending request with Postman, Refinitiv provided Python script: https://raw.githubusercontent.com/Refinitiv/websocket-api/master/Applications/Examples/EDP/python/market_price_edpgw_service_discovery.py
Result is totally same.