Hello, I am connecting to Pabbly API from a custom application written in Java using spring framework.
I am testing connection by using this API link:
in the request header I am providing API credentials like this:
String plainCreds = "[API Key]:[Secret Key]; // Use actual values from pabbly
byte[] plainCredsBytes = plainCreds.getBytes();
Encoder enc = Base64.getEncoder();
byte[] base64CredsBytes = enc.encode(plainCredsBytes);
String base64Creds = new String(base64CredsBytes);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Basic " + base64Creds);
RestTemplate restTemplate = new RestTemplate();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
HttpEntity<String> entity = new HttpEntity<>(headers);
Map<String, Object> pabblyResponse = (Map<String, Object>) restTemplate.exchange(uri, HttpMethod.POST, entity, Map.class);
--------
at this point my page shows that message 404 Not Found
How can it be resolved?
Please help
Thanks
Kate
I am testing connection by using this API link:
in the request header I am providing API credentials like this:
String plainCreds = "[API Key]:[Secret Key]; // Use actual values from pabbly
byte[] plainCredsBytes = plainCreds.getBytes();
Encoder enc = Base64.getEncoder();
byte[] base64CredsBytes = enc.encode(plainCredsBytes);
String base64Creds = new String(base64CredsBytes);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Basic " + base64Creds);
RestTemplate restTemplate = new RestTemplate();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
HttpEntity<String> entity = new HttpEntity<>(headers);
Map<String, Object> pabblyResponse = (Map<String, Object>) restTemplate.exchange(uri, HttpMethod.POST, entity, Map.class);
--------
at this point my page shows that message 404 Not Found
How can it be resolved?
Please help
Thanks
Kate