It looks like you're new here. If you want to get involved, click one of these buttons!
public void getAccessToken(String requestToken,String apiKey, String secretKey) {
        PostMethod postMethod = null;
        try {
            postMethod = new PostMethod("https://api.kite.trade/session/token");
        postMethod.addParameter("api_key", apiKey);
        postMethod.addParameter("request_token", requestToken);
        postMethod.addParameter("checksum", getSHA256Hash(apiKey+requestToken+secretKey));
            HttpClient client = new HttpClient();
            int httpStatusCode = client.executeMethod(postMethod);
            System.out.println("HTTPStatusCode [" + httpStatusCode + "] [" + postMethod.getResponseBodyAsString() + "]");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (postMethod != null) {
                postMethod.releaseConnection();
            }
        }
    }
private String getSHA256Hash(String data) {
        String result = null;
        try {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            byte[] hash = digest.digest(data.getBytes(StandardCharsets.UTF_8));
//            return String.valueOf(hash);
            return DatatypeConverter.printHexBinary(hash); // make it printable
        }catch(Exception ex) {
            ex.printStackTrace();
        }
        return result;
    }
