API Module SpamExperts createDomainSeRequest

From Openprovider API documentation

Jump to: navigation, search

Contents

Module SpamExperts > Create Domain

Module SpamExperts
Command name createDomainSeRequest
Use Adds a domain filter to the active SpamExperts bundle
Input
  • domainName
  • destinations
  • products
  • aliases
Output Even if filter was added correctly, output might include warnings from SpamExperts

Examples

Using PHP class

$request = new OP_Request;
$request->setCommand('createDomainSeRequest')
  ->setAuth(array('username' => $username, 'password' => $password))
  ->setArgs(array(
    'domainName' => 'newfilter.nl',
    'destinations' => array(
      array('hostname' => 'mail.newfilter.nl', 'port' => 25),
      array('hostname' => 'fallback.newfilter.nl', 'port' => 100)
    ),
    'products' => array(
      'incoming' => 1,
      'outgoing' => 1,
      'archiving' => 0,
    ),
    'aliases' => array(
      'newfilter.com',
      'newfilter.net',
    ),
  ));

Raw XML

Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.

<?xml version="1.0" encoding="UTF-8"?>
<openXML>
  <credentials>
    <username>username</username>
    <password>password</password>
  </credentials>
  <createDomainSeRequest>
    <domainName>newfilter.nl</domainName>
    <destinations>
      <array>
        <item>
          <hostname>mail.newfilter.nl</hostname>
          <port>25</port>
        </item>
        <item>
          <hostname>fallback.newfilter.nl</hostname>
          <port>100</port>
        </item>
      </array>
    </destinations>
    <products>
      <array>
        <item>
          <incoming>1</hostname>
        </item>
        <item>
          <outgoing>1</outgoing>
        </item>
        <item>
          <archiving>0</archiving>
        </item>
      </array>
    </products>
    <aliases>
      <array>
        <item>newfilter.com</item>
        <item>newfilter.net</item>
      </array>
    </aliases>
  </createDomainSeRequest>
</openXML>
<?xml version="1.0" encoding="UTF-8"?>
<openXML>
  <reply>
    < code>0</code>
    <desc />
    <data>
      <id>214</id>
      <message>WARNING: Unable to deliver mail through host mail.newfilter.nl:25
WARNING: Unable to deliver mail through host fallback.newfilter.nl:100
      </message>
    </data>
  </reply>
</openXML>
Views
Personal tools