1

In the Tooling API Guide entry for AutoResponseRule, it says

More information about the autoresponse rule is available by querying the metadata type AutoResponseRules or AutoResponse in the metadata namespace (mns).

Which lead me to Tooling API Objects and Namespaces, which lists four namespaces from the Tooling API WSDL, including metadata.tooling.soap.sforce.com, with the prefix mns.

This seems to imply that you can fetch (at lease some?) Metadata types via Tooling API via the mns namespace, but I can find no examples of such. Additionally, I can't find any reference to accessing alternate namespaces via REST. I tried a simple guess based on the Tooling API AutoResponse docs linked above, with this Tooling API query:

SELECT Id, Name from mns__AutoResponseRules

but of course I got the expected "sObject type mns__AutoResponseRules' is not supported" error, and the same without the mns__ prefix. So what do the docs mean by "querying the metadata type AutoResponseRules or AutoResponse in the metadata namespace (mns)," and is such an operation possible via the Tooling API's REST version?

2 Answers 2

0

I think you are just using extra 's' in sobject name. you can try

select id from AutoResponseRule
1
  • Sadly, no; see my first link. The Tooling API object is AutoResponseRule (singular), but "More information about the autoresponse rule is available by querying the metadata type AutoResponseRules [Plural] or AutoResponse in the metadata namespace (mns)." I have also confirmed this by retrieving AutoResponseRules (plural) using Metadata API. But I remain curious if there is a way to use (REST) Tooling API to fetch additional Metadata API info via the "mns" namespace. Commented Feb 2 at 14:13
0

I was unable to retrieve the "extra" information mentioned in the documentation using the REST API. It appears that Metadata NameSpace (mns) is part of the WSDL Metadata API, and I was able to obtain the information using the SOAP API. Here is the configuration for that:

First, you need to create a POST request directed to {{your_instance}}/services/Soap/m/61.0. Ensure you include the following headers:header example for SOAPAPI call

Send following payload in the request body:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soap:Header>
       <met:SessionHeader>
           <met:sessionId>{session_id}</met:sessionId>
       </met:SessionHeader>
   </soap:Header>
   <soap:Body>
       <met:readMetadata>
        <met:type>AutoResponseRules</met:type>
        <met:fullNames>Case</met:fullNames>
     </met:readMetadata>
   </soap:Body>
</soap:Envelope>

The response will include detailed RuleEntries, CriteriaItems, senderEmail, senderName and the email template.

Hope this helps!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .