Is it possible to create a page with same Title?

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;

 

1 answer

1 accepted

This widget could not be displayed.

No, you cannot duplicate page ids - the whole point of an id is that it uniquely identifies a single page.

As far as I know, there's no explicit "check for existence" call in the REST API, so I think you're expected to do "try to get page information" and then catch the "page does not exist" error if it's not there.

Thanks a lot NIC

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

430 views 4 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you