Forum Discussion

nebuthomasmathew's avatar
nebuthomasmathew
Copper Contributor
Feb 04, 2024

Audience Ids returning null | SharePoint REST API

Hi,

On hitting the SharePoint REST API in the endpoint "_api/Web/Navigation/GetNodeById(2019)/AudienceIds", I am getting a NULL response as seen below

apiNull

But I have added SharePoint groups as audience on the below

 

addAud

Can you look into the above matter and help ?

 

Regards,

Nebu Thomas Mathew

1 Reply

  • guylee's avatar
    guylee
    Occasional Reader

    I ran into this yesterday and finally found a solution.  The issue is with the endpoint you are using.  That is, you'll need to use either: _api/navigation/menustate?mapprovidername='CurrentNavigationSwitchableProvider' OR _api/navigation/menustate?mapprovidername='GlobalNavigationSwitchableProvider' and then search for your item.  The Audience is a custom property which contains the Group Names (not the ids of the groups).


Resources