Handle duplicate webhooks
This commit is contained in:
@@ -77,7 +77,7 @@ public class WebexService {
|
||||
}
|
||||
}
|
||||
|
||||
public void post(Message m) throws ServiceException {
|
||||
public String post(Message m) throws ServiceException {
|
||||
try (HttpClient client = HttpClient.newHttpClient()) {
|
||||
|
||||
Room room = getRoomByClient(m.getClientId());
|
||||
@@ -91,7 +91,9 @@ public class WebexService {
|
||||
"text", m.getContent()
|
||||
);
|
||||
|
||||
sendPostRequest(client, "https://webexapis.com/v1/messages", botToken, body);
|
||||
String response = sendPostRequest(client, "https://webexapis.com/v1/messages", botToken, body);
|
||||
JsonNode jsonNode = mapper.readTree(response);
|
||||
return jsonNode.get("id").asText();
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.displayError(Arrays.toString(e.getStackTrace()));
|
||||
|
||||
Reference in New Issue
Block a user