Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Remove from favorites Remove from favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (26 votes)

61% thumbs up 38% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Email Marketer XML API usage and examples

You can download our official XML API documentation here

Email Marketer's API can be invoked by sending XML requests. The API files are found in the /emailmarketer/admin/functions/api/ directory. Each XML request requires a username, user token, request type, request method, and details. The API file containing the method you want to invoke is the request type, the method itself is the request method, and the method's parameters are the details. Email Marketer's source code is commented in a format that allows scripts like phpDocumentor to generate documentation. Each class and method contains a detailed description. You can download phpDocumentor for free at phpdoc.org. Following is an example of a XML API request sent through PHP with cURL. There are also several example scripts attached at the bottom for your reference.

 

<?php
//searchinfo
// must contain a list id: <List>1</List> or <List>any</List>
// You can also filter the search by Status, Confirmed, CustomFields, Subscriber, Email, Format, Newsletter, Link, etc
// I took the list above from the function GenerateSubscriberSubQuery line 2199 of /api/subscribers.php
$xml = "
<xmlrequest>
    <username>YOUR_USERNAME_HERE</username>
    <usertoken>YOUR_TOKEN_HERE</usertoken>
    <requesttype>subscribers</requesttype>
    <requestmethod>GetSubscribers</requestmethod>
    <details>
        <searchinfo>
            <List>1</List>
            <Status>a</Status>
            <Confirmed>1</Confirmed>
        </searchinfo>
    </details>
</xmlrequest>
";

$ch = curl_init('http://YOUREMAILMARKETER.com/xml.php'); //change to the path to your xml.php file
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$result = @curl_exec($ch);
if($result != false) {
    $xml_doc = simplexml_load_string($result);
    if($xml_doc != false){
        echo "Result: <br />";
        var_dump($xml_doc);
        echo "<br /><br />";
    }        
} else {
        echo "Error performing request: <br />";
        var_dump($result);
        echo "<br /><br />";
    }    

?>

 



Related Articles

No related articles were found.

Attachments


Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software