DNSTemplatesAddRedirection

Create a new DNS redirection within a DNS template

Input

Parameter Value Example value
id DNS template ID
retrieve with DNSListTemplates.
Parameter is required
5001
from Subdomain from
Leave empty for main domain
Parameter is required
mysubdomain (or empty)
to DNS redirect destination
Always needs to contain http:// or https://.
Parameter is required
MX


Output

Parameter Value Example value
success command executed successfully 0 = error
1 = command executed successfully
command_response_message Error
Only sent when value parameter success = 0
incorrect password
record_id DNS redirection ID
Only sent when value parameter success = 1
949244


Example

<? require("class_versio_api.php"); unset($command); $command = array( "command" => "DNSTemplatesAddRedirection", "id" => "5001", "from" => "mysubdomain", "to" => "http://www.redirection.uk" ); $api = new Versio_api(); $versio = $api->api_send( $command ); IF($versio['success']==0) { echo("Error occured. Error code: ".$versio['command_response_code'].". Error message: ".$versio['command_response_message'].""); } else { echo("Succes! Redirection created with following ID: ".$versio['record_id']."."); } ?>