Is there a way to get a named credential URL into a variable in apex?
It looks like the named credential path only works for the setEndpoint method.
According to the
SOAP API Developer Guide, the
NamedCredential object has a field named
The root URL of the endpoint.
So you should be able to do a query like:
SELECT DeveloperName, Endpoint FROM NamedCredential