When installing a package using the links it asks the user to confirm the addition of remote site settings.
When installing a package via the Metadata API using createMetadata()
or the packaging API the remote site settings do not get activated and there is no prompt for the user to approve.
Does anyone know of a way to get the remote site settings to be activated during a package install via the API?
I assume there is not but interested to hear if there are any good ideas out there. I do not need code or anything but if there is a setting or field in the XML that can be passed it would be nice to know.
My current approach will be to develop a UI after the installation is complete for them to activate any inactive remote site settings within the namespace
UPDATE: Based on below answer
I tried using postman and my code and get HTTP error code 500 with the following:
endpoint
https://[redacted]-dev-ed.cs8.my.salesforce.com/services/Soap/m/43.0/ORGID
payload
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<urn:SessionHeader xmlns:urn="http://soap.sforce.com/2006/04/metadata">
<urn:sessionId>redacted</urn:sessionId>
</urn:SessionHeader>
</env:Header>
<env:Body>
<createMetadata xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xsi:type="InstalledPackage">
<activateRss>true</activateRss>
<versionNumber>version</versionNumber>
<fullName>namespace</fullName>
</metadata>
</createMetadata>
</env:Body>
</env:Envelope>
and I receive the following response. I tried putting the tag in all positions without but the results were the same
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>Element {http://soap.sforce.com/2006/04/metadata}activateRss invalid at this location in type InstalledPackage</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Must be a field returned by readMetadata and not available on createMetadata??