我已经得到了的会话令牌(RDP Token), 请问是否有java请求ESG数据的代码实例 ?
比如希望获取下面的数据
https://api.refinitiv.com/data/environmental-social-governance/v1/views/basic?universe=IBM.N
下面是我的代码:
StringBuilder url = new StringBuilder("https://api.refinitiv.com/data/environmental-social-governance/v1/views/basic?universe=IBM.N");
HttpGet request = new HttpGet(url.toString())。
request.addHeader("Authorization", "Bearer " + sessionToken);
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse httpResponse = httpClient.execute(request);
BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity).getContent())
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = reader.readLine()) != null) {
response.append(inputLine)。
}
System.out.println(response.toString())。
httpClient.close()。
但我得到了如下错误信息
{"error":{"id":"107c01c3-fbfb-4217-8169-dadb2439b61d","code":"insufficient_scope","message":"access denied. Scopes required to access the resource: [trapi.data.esg.views-basic.read]。缺少作用域。[trapi.data.esg.views-basic.read]", "status": "Forbidden"}}.