I've found what I think might be a bug in Confluence Servers v6.9.0 and 6.3.4
When you use the REST API to query the root page to get its ID (using a GET to the URL https://{MyServer}/rest/api/space/{SpaceKey}/content/page?depth=root ) the value returned for the id has an errant extra space after the numerical value. IE, if the root page's id is 12345678, as shown via the Page Information page, the value returned by the API is "12345678 "
That extra character needs to be removed if the id number is to be used in subsequent REST API queries to create pages with the root as the ancestor.
Can anyone else confirm this issue?
I'm going to raise this as a bug with the Atlassian devs and see if they can advise of the cause.