We use cookies on our website to ensure we provide you with the best experience on our website. By using our website, you agree to the use of cookies for analytics and personalized content.This website uses cookies. More Information
It seems like your browser didn't download the required fonts. Please revise your security settings and try again.

Config.create

  • Last updated on

This method creates an object of a given type and name under the specified parent path. Required variables will be set to their defaults if they have one; otherwise you must ensure that they have a value before a commit.

Parameters Allowed

The following variables are used by the config.create method and should be provided as part of the request XML in the HTTP POST request:

  • password – A required parameter which the API uses to authenticate access to a page and which is set by your administrator.
  • parent_type – A required parameter that tells the API about the class/scope of the parent container.
  • parent_path – A required parameter that is the qualified name of a parent object under which a new object will be created.
  • type – A required parameter that specifies the child's class/scope to be created.
  • name – A required parameter that specifies the name of an object to be created.
  • variable list – An optional parameter that tells the API which variable(s) to set in the new object.

Example 1: Create a scoped object in global scope -  a new domain

Create a new domain entry of 'xyz.com' under global scope and set the value of variable scana_pd_block_level  (per-domain Spam Block level) to '5'.

Arguments
  • parent_type: 'global'
  • parent_path: ''
  • type: 'domain'
  • name: 'xyz.com'
  • variable list: scana_pd_block_level = '5'
Sample Request
 <?xml version="1.0" encoding="UTF8"?>
<methodCall>
 <methodName>config.create</methodName>
  <params>
    <param>
     <value>
       <struct>
        <member>
          <name>scana_pd_block_level
          </name>
          <value>
           <i4>5</i4>
          </value>
         </member>
         <member>
          <name>parent_type
          </name>
           <value>
            <string>
             <![CDATA[global]]>
            </string>
           </value>
          </member>
          <member>
           <name>name</name>
            <value>
             <string>
              <![CDATA[xyz.com]]>
             </string>
            </value>
          </member>
          <member>
           <name>type</name>
            <value>
             <string>
              <![CDATA[domain]]>
             </string>
            </value>
           </member>
           <member>
            <name>parent_path</name>
             <value>
              <string></string>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>

Example 2: Create a tied object -  custom RBL with a custom action

Create a tied object mta_rbl_custom_name of 'spamblocklist.org' with an mta_rbl_custom_action of 'Block'. The resulting entries in the configuration would look something like this:

  • # Custom RBL List
  • mta_rbl_custom_name = spamblocklist.org
Arguments
  • parent_type:'global'
  • parent_path: ''
  • type: 'mta_rbl_custom_name'
  • name: 'spamblocklist.org'
  • variable list: mta_rbl_custom_action = Block
Sample Request
 <?xml version="1.0" encoding="UTF8"?>
<methodCall>
<methodName>config.create</methodName>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>parent_type</name>
      <value>
       <string><![CDATA[global]]></string>
      </value>
     </member>
     <member>
      <name>name</name>
       <value>
        <string><![CDATA[spamblocklist.org]]></string>
       </value>
     </member>
     <member>
      <name>type</name>
       <value>                   
        <string>
         <![CDATA[mta_rbl_custom_name]]>
        </string>
       </value>
      </member>
      <member>
       <name>parent_path</name>
        <value>
         <string></string>
        </value>
         </member>
          <member>
           <name>mta_rbl_custom_action</name>
           <value>
            <string><![CDATA[Block]]></string>
           </value>
          </member>
          </struct>
        </value>
      </param>
   </params>
</methodCall>
Last updated on