Need Java Code For World Check API

Dear Team,
I download the code from download tab from developer community. for use that java code able to retrieve the values for SEQ 1a and SEQ 2b. And not able to retrieve the remaining functions for ex: SEQ 1b,SEQ-1c,SEQ-4a,SEQ-5b,SEQ-5c. and also we getting "HTTP/1.1 401 Unauthorized" Error.
Please help us. and find my code below for reference.
Java Code:
String jsonBody1 = "{\"secondaryFields\":[],\"entityType\":\"INDIVIDUAL\",\"customFields\":[],\"groupId\":"+groupid+",\"providerTypes\":[\"WATCHLIST\"],\"name\":\"george w bush\"}";
// create a JSON object from the JSON
string
JSONObject jo = new JSONObject(jsonBody1);
//System.out.println(jo.toString());
String jlen = String.valueOf(jo.toString().length());
//SEQ-4a-postscreencase
String dataToSign = "(request-target): post " + gatewayurl + "cases/" + casesystemid + "/screeningRequest\n" +
"host: " + gatewayhost + "\n" +
"date: " + date + "\n" +
"content-type: " + "application/json" +"\n" +
"content-length: " + jlen + "\n" +
jo;
//SEQ-2b-postsavesimplecase
String hmac = generateAuthHeader(dataToSign, apisecret);
String authorisation = "Signature keyId=\"" + apikey + "\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date content-type content-length\",signature=\"" + hmac + "\"";
System.out.println("jlen : "+jlen);
System.out.println("dataToSign : "+dataToSign);
System.out.println("hmac : "+hmac);
System.out.println("authorisation : "+authorisation);
String msg = jo.toString();
HttpPost httpPost = new HttpPost("https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/cases");
HttpEntity entity = new StringEntity(msg);
httpPost.setEntity(entity);
httpPost.addHeader("Date", date);
httpPost.addHeader("Cache-Control", "no-cache");
httpPost.addHeader("Content-Type", "application/json" );
httpPost.addHeader("Authorization", authorisation);
// send the POST request
CloseableHttpResponse response1 = httpclient.execute(httpPost);
try {
HttpEntity entity1 = response1.getEntity();
System.out.println("response1.getStatusLine() : "+response1.getStatusLine());
String json = EntityUtils.toString(response1.getEntity());
Best Answer
-
Hi @sanjay.mishra,
We do not support IDE/Language environments nor the development of your application. The code examples in the Downloads section are for example only and as you point out they work. You'll need to read the documentation on how to make requests to the other endpoints. Look at the Postman collection examples in detail, each request has different environment settings and pre-Request Script, then compare to the example Java code, you should see your coding errors.
Brian
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 280 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 720 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛