From Openprovider API documentation
Module DNS template > Create
Module
| DNS template
|
Command name
| createTemplateDnsRequest
|
Use
| Creates a new DNS zone template object
|
Input
|
- name
- records
- isSpamexpertsEnabled (to enable spam filtering by default on domain created with this DNS zone template, default value: 0)
|
Output
| Result set of DNS template details:
|
Examples
Using PHP class
$request = new OP_Request;
$request->setCommand('createTemplateDnsRequest')
->setAuth(array('username' => 'username', 'password' => 'password'))
->setArgs(array(
'name' => 'Demo',
'records' => array(
array(
'type' => 'A',
'name' => "",
'value' => '89.255.0.43',
'ttl' => 86400
),
array(
'type' => 'A',
'name' => '*',
'value' => '89.255.0.43',
'ttl' => 86400
),
array(
'type' => 'MX',
'name' => "",
'value' => 'mail.%domain%',
'prio' => 10,
'ttl' => 86400
)
)
));
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>
<createTemplateDnsRequest>
<name>Demo</name>
<records>
<array>
<item>
<type>A</type>
<name></name>
<value>89.255.0.43</value>
<ttl>86400</ttl>
</item>
<item>
<type>A</type>
<name>*</name>
<value>89.255.0.43</value>
<ttl>86400</ttl>
</item>
<item>
<type>MX</type>
<name></name>
<value>mail.%domain%</value>
<prio>10</prio>
<ttl>86400</ttl>
</item>
</array>
</records>
</createTemplateDnsRequest>
</openXML>
<?xml version="1.0" encoding="UTF-8"?>
<openXML>
<reply>
<code>0</code>
<desc></desc>
<data>5936</data>
</reply>
</openXML>