I would like to frame an API call, such that for a given Page Id, it should return the immediate children and whether those children have any children.
Ex: If Page A has 2 children (Page B and Page C and only Page C has Children, but not Page B, then the API call should tell me that.)
How can I frame such API call?
This API call returns the immediate children, but does not let me know if each page has any children or not:
/rest/api/content/PageId/child?expand=page