Aug 01 2023 04:08 AM
I have a top hub and a child hub. I want the child hub to have the same hub navigation as the parent hub.
Is there a way to get the navigation using REST API? I want to build an extension that will replace the child hub navigation.
Aug 01 2023 05:06 AM - edited Aug 01 2023 05:08 AM
the Hub site navigation is basically just the "TopNavbar" navigation of the Hub site.
So just use this endpoint
<Hubsite>/_api/web/navigation/TopNavigationbar
to get the root elements and then use the top level node IDs to get their children
<Hubsite>/_api/web/Navigation/GetNodeById(<nodeID>)/children
But if you want both hubs to have the same navigation: Why are you having two hubs at all? Could this be easier, if you just use one Hub?
Best Regards,
Sven