Forum Discussion
arsenioferraz
Aug 01, 2023Copper Contributor
Is it possible to get the SharePoint HUB navigation using REST API?
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 wil...
SvenSieverding
Aug 01, 2023Bronze Contributor
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