I am trying to pull the namedcredentials using getNamedCredentials() method in apex but it's not working in anonymous window. This is the error I am getting.
error:
Method does not exist or incorrect signature: void getNamedCredentials() from the type List<ConnectApi.NamedCredentialList> tried this:
ConnectApi.NamedCredentialList nl = ConnectApi.NamedCredentialList.getNamedCredentials(); List <ConnectApi.NamedCredentialList> nl = ConnectApi.NamedCredentialList.getNamedCredentials(); How do I call this method correctly ?
sf article I am following: link