For a deeper look into our World Check One API, look into:

Overview |  Quickstart |  Documentation |  Downloads


1 2 3 1

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);


String jlen = String.valueOf(jo.toString().length());


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;


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("");

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());

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

3.1k 18 7 7

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.


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.