I am able to post to Chatbase https://chatbase.com/api/message
via SoapUI and curl requests. However when I attempt to post using restTemplate to the same endpoint using the same headers and same body I am getting a {"reason": "Unknown server error.", "status": 500}
.
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
MultiValueMap<String, String> body = new LinkedMultiValueMap<>();
body.add("api_key", "myApiKey");
body.add("platform", "Web");
body.add("user_id", "1");
body.add("type", "user");`
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(body, headers);
restTemplate.exchange("https://chatbase.com/api/message", HttpMethod.POST, request, Void.class);
I have tried everything I can think of, any help is appreciated.
Here is the implementation that ended up working for us.
Thanks for the help Chatbase! Great response time via email and stack overflow.