Is there a way to list all full names of remote site settings in an org dynamically ?
1 Answer
You can just build a package.xml to pull all RemoteSiteSetting metadata with the wildcard character *
(asterisk).
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>RemoteSiteSetting</name>
</types>
<version>52.0</version>
</Package>
You also have a couple different options depending on your need:
In the CLI, you could simply do
sfdx force:source:retrieve -m RemoteSiteSetting
The Tooling API has RemoteProxy exposed which allows you to query all your remote site settings as well.
/services/data/v52.0/tooling/query?q=select+Id,FullName+from+RemoteProxy
With a return like so
{
"size" : 1,
"totalSize" : 1,
"done" : true,
"queryLocator" : null,
"entityTypeName" : "RemoteProxy",
"records" : [ {
"attributes" : {
"type" : "RemoteProxy",
"url" : "/services/data/v52.0/tooling/sobjects/RemoteProxy/0rp..."
},
"Id" : "0rp...",
"FullName" : "YourRemoteSiteSetting"
} ]
}