Omnistar Affiliate Software User Guide

1. Introduction


The XML API functionality use to turn off or turn on Reoccuring functionality for affiliate users remotely.


2. System Requirements


For using the XML API functionality server must be running PHP 5.1.2 or higher with cURL support.


3. Submitting a Request


For using the XML API functionality you can submit the request through cURL with valid XML format. The XML Path will look similar to the following:

http://www.yourdomain.com/affiliate/xml_reoccurring.php

 

For example : http://test.omnistaretools.com/affiliate/xml_reoccurring.php


Following are the sample for using the XML API functionality:


a) For Turn off Reoccuring:


    <?php

    $content = '<?xml version="1.0"?>

    <xmlrequest>

    <username>admin</username>

    <usertoken>6e3c7d36608d44001ce13f4d18d64959</usertoken>

    <requestmethod>TurnOffReoccuring</requestmethod>

    <details>

    <item>

    <fieldname>Email:</fieldname>

    <value>email@com</value>

    </item>

    <item>

    <fieldname>Allow Reoccuring:</fieldname>

    <value>0</value>

    </item>

    </customfields>

    </details>

    </xmlrequest>';

    $ch = curl_init("http://www.yourdomain.com/affiliate/xml_reoccurring.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "xml=$content");
    $result = @curl_exec($ch);
    if($result === false) {

    echo "Error performing request";

    }

    else {

    $xml_doc = simplexml_load_string($result);

    echo 'Status is ', $xml_doc->status, ' </br> ';

    if ($xml_doc->status == 'SUCCESS') {

    echo 'Data : <b>', $xml_doc->data, '</b><br/>';

    } else {

    echo 'Error : <b>', $xml_doc->errormessage, '</b><br/>';

    }

    }

    curl_close($ch);

    ?>

    The XML document structure for Turn off Reoccuring for affiliate user:

    xmlrequest (Required) This is the root document tag name.
    username (Required) This is the admin user name.
    usertoken (Required) This is user token number like password for using the API. You can get it from: http://test.omnistaretools.com/affiliate/admin/admin.php
    requestmethod (Required) This is the method name for API, For adding the affiliate users method name is “TurnOffReoccuring”.
    details (Required) This is the details of affiliate users.
    Email (Required) This is the affiliate email Id
    Allow Reoccuring (Required) This is the value(0 or 1) to turn off or turn on functionality.

    If successfully then it will return the success message .

     

    b) For Turn on Reoccuring:

     

    <?php

    $content = '<?xml version="1.0"?>

    <xmlrequest>

    <username>admin</username>

    <usertoken>6e3c7d36608d44001ce13f4d18d64959</usertoken>

    <requestmethod>TurnOffReoccuring</requestmethod>

    <details>

    <item>

    <fieldname>Email:</fieldname>

    <value>email@com</value>

    </item>

    <item>

    <fieldname>Allow Reoccuring:</fieldname>

    <value>1</value>

    </item>

    </customfields>

    </details>

    </xmlrequest>';

    $ch = curl_init("http://www.yourdomain.com/affiliate/xml_reoccurring.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "xml=$content");
    $result = @curl_exec($ch);

    if($result === false) {

    echo "Error performing request";

    }

    else {

    $xml_doc = simplexml_load_string($result);

    echo 'Status is ', $xml_doc->status, ' </br> ';

    if ($xml_doc->status == 'SUCCESS') {

    echo 'Data : <b>', $xml_doc->data, '</b><br/>';

    } else {

    echo 'Error : <b>', $xml_doc->errormessage, '</b><br/>';

    }

    }

    curl_close($ch);

    ?>

    The XML document structure for Turn on Reoccuring for affiliate user:

    xmlrequest (Required) This is the root document tag name.
    username (Required) This is the admin user name.
    usertoken (Required) This is user token number like password for using the API. You can get it from: http://test.omnistaretools.com/affiliate/admin/admin.php
    requestmethod (Required) This is the method name for API, For adding the affiliate users method name is “TurnOnReoccuring”.
    details (Required) This is the details of affiliate users.
    Email (Required) This is the affiliate email Id
    Allow Reoccuring (Required) This is the value(0 or 1) to turn off or turn on functionality.

    If successfully then it will return the success message.