public class SanctionsRepo { final static Logger logger = LoggerFactory.getLogger(SanctionsRepo.class); @Value("${worldcheck.api.host}") private String url; public ResponseEntity getSkuldGroupId(String authorization) { RestTemplate restTemplate = new RestTemplate(); HttpEntity httpEntity = new HttpEntity(getHttpHeaders(authorization)); ResponseEntity response = null; try{ response = restTemplate.exchange (url + "/v1/groups", HttpMethod.GET, httpEntity, String.class); }catch (Exception e){ e.getCause(); } return response; } private HttpHeaders getHttpHeaders(String authorisation) { HttpHeaders headers = new HttpHeaders(); headers.add("Authorization", authorisation); headers.add("Cache-Control", "no-cache"); headers.add("Date", Config.getDate()); return headers; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }