Hello All,
We are developing a tool on top of confluence app by calling Restful API expose to extend the App.
Requirement:-
-----------------
To Create new page, but in case, accidentally if end user try to create the confluence page using developed tool we added below mention Logic[i.e. Code snippet] which would check the Title duplication.
Request:-
------------
Is there any other way to check duplication of PageID part? or Error 203
Code snippet:-
------------------
String pageID = null;
try {
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.POST, entity, String.class);
JSONObject responseObject = new JSONObject(response.getBody());
pageID = responseObject.getString("id");
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new ConfluenceException("Page can not be created", e, ConfluenceErrorCodes.ALREADY_EXISTS);
}
return pageID;
}
Constants Files define to Catching the Errors:-
int ALREADY_EXISTS = 203;