<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel><title><![CDATA[Interspire Developer Network - Comments for article: Interspire Email Marketer XML API Documentation]]></title><link>http://idn.interspire.com</link><description /><language>en-us</language><copyright><![CDATA[http://idn.interspire.com]]></copyright><generator>N/A</generator><webMaster>mitchell.harper@interspire.com</webMaster><lastBuildDate>Sat, 21 Nov 2009 00:08:39 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment43</link><description><![CDATA[Firstly, wouldnt it be far more elegant and practical to use XML-RPC rather than pure XML? almost all major languages and CMS systems support XML-RPC so it would have seemed a far more logical choice.

Secondly is there any chance of seeing a roadmap of proposed APIs. Out of frustration we have built an API for the old SendStudio product that does all of above as well as schedule jobs and much more. We are struggling to decide if to keep working on this or switch over to the official API but with no information on the future of it, its very hard to know what to do.<br/><br/>
(Comment posted by Tom Cameron at 6:09 pm, Thu 17th Jul 2008)]]></description><author>no@spam.com (Tom Cameron)</author><pubDate><![CDATA[Thu, 17 Jul 2008 18:09:21 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment43</guid></item><item><title><![CDATA[Comment #2 (Reply to Comment #1)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment49</link><description><![CDATA[Hi Tom,

The XML API is only in the initial stages of development and will grow in functionality as the needs arise and as time goes on. It&#039;s using REST rather than XML-RPC or SOAP as it&#039;s easier/quicker to get started.

You can use the normal API that is within SendStudio and Email Marketer to perform all the tasks that the application is capable of. If you need any help with the API please open a support ticket and we can send you some information.

<br/><br/>
(Comment posted by scott at 7:57 pm, Mon 21st Jul 2008)]]></description><author>no@spam.com (scott)</author><pubDate><![CDATA[Mon, 21 Jul 2008 19:57:53 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment49</guid></item><item><title><![CDATA[Comment #3]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment44</link><description><![CDATA[Here some developer hints:

Unfortunatly these seem to be the only supported operations. If you call some other function out of a class, you may get non-sense returns (like empty &quot;data&quot; node).

Pretty bad if someone would like to build up a connector between two systems like a onlineshop and the email marketer. But obviously it works only fine if no sophisticated functions are needed.

May someone find this useful:

If you get a XML document back and want to transform that in a nicely and well formed Array tree use this class:

class XMLparserSimpleXML {
	function parse($data) {
		$data = ltrim($data);
		$xml = simplexml_load_string($data);
		if($xml !== false) {
			// now convert $xml obj into a nice array structure
			return $this-&gt;buildArray($xml);
		}
		return false;
	}
	
	function buildArray($xml, $rec=0) {
		$data = trim((string)$xml);
		if($data == &quot;&quot;) {
			$data = array();
			foreach($xml-&gt;children() as $child) {
				$data[$child-&gt;getName()] = $this-&gt;buildArray($child, $rec+1);
			}
		}
		if($rec &gt; 0) {
			return $data;
		} else {
			return array($xml-&gt;getName() =&gt; $data);
		}
	}
}

Now you get a nicely formed Array structure like:

Array(
   &quot;response&quot; = Array(
           &quot;status&quot; =&gt; &quot;SUCCESS&quot;
           &quot;data&quot; =&gt; Array (
                  .....
           )
       )
)

I would really appreciate if the XML API could hold more features than just these few basic commands as remote webservices are really conveniant for scalable distributed and highly flexible systems.<br/><br/>
(Comment posted by D.P. at 2:35 am, Fri 18th Jul 2008)]]></description><author>no@spam.com (D.P.)</author><pubDate><![CDATA[Fri, 18 Jul 2008 02:35:28 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment44</guid></item><item><title><![CDATA[Comment #4 (Reply to Comment #3)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment47</link><description><![CDATA[Hi D.P.

Thank you for your suggestion. We are looking to add more functionality to the XML API as we progress. 

If you have any suggestions as to functionality for this please don&#039;t hesitate to open a support ticket with your questions and comments and we will do our best to help you out.<br/><br/>
(Comment posted by scott at 7:43 pm, Mon 21st Jul 2008)]]></description><author>no@spam.com (scott)</author><pubDate><![CDATA[Mon, 21 Jul 2008 19:43:47 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment47</guid></item><item><title><![CDATA[Comment #5]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment97</link><description><![CDATA[It should be noted that the new XML API *is* actually quite a bit more flexible than this document lets on.  As noted around line 373 in xml.php, the requesttype and requestmethod child nodes of the request element hold values that correspond to the file name and method within the admin/functions/api directory.  For example, you can access the Subscribers_API::IsUnSubscriber() to check if particular email address is listed as an unsubscriber to a specified list.  Do it like this:
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xmlrequest&gt;
	&lt;username&gt;cesystem&lt;/username&gt;
	&lt;usertoken&gt;abc123abc123abc123abc123abc123abc123abc123abc123&lt;/usertoken&gt;
	&lt;requesttype&gt;subscribers&lt;/requesttype&gt;
	&lt;requestmethod&gt;IsUnSubscriber&lt;/requestmethod&gt;
	&lt;details&gt;
		&lt;emailaddress&gt;example@example.com&lt;/emailaddress&gt;
		&lt;listId&gt;4&lt;/listId&gt;
	&lt;/details&gt;
&lt;/xmlrequest&gt;


&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;response&gt;
	&lt;status&gt;SUCCESS&lt;/status&gt;
	&lt;data&gt;74

	&lt;/data&gt;
&lt;/response&gt;

In this case, the response includes the numeric subscriber ID, so the supplied email address *is* in the list as an unsubscriber.  Some responses will include the relevant data in &lt;item&gt; elements.

Also, the examples above use simple XML strings, but of course it will be easier to build your requests using something like SimpleXMLElement.<br/><br/>
(Comment posted by Max Schwanekamp at 7:19 pm, Tue 16th Sep 2008)]]></description><author>no@spam.com (Max Schwanekamp)</author><pubDate><![CDATA[Tue, 16 Sep 2008 19:19:28 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment97</guid></item><item><title><![CDATA[Comment #6 (Reply to Comment #5)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment214</link><description><![CDATA[Yes this is correct.<br/><br/>
(Comment posted by hendri at 6:55 pm, Tue 17th Feb 2009)]]></description><author>no@spam.com (hendri)</author><pubDate><![CDATA[Tue, 17 Feb 2009 18:55:16 CST]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment214</guid></item><item><title><![CDATA[Comment #7]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment357</link><description><![CDATA[Seems to be a bug with the IsSubscriberOnList in IEM 5.5...
whatever email i specify, it returns me SUCCESS everytime... which is a bug !
Going to fix it ?<br/><br/>
(Comment posted by MONTARD at 7:58 am, Thu 23rd Jul 2009)]]></description><author>no@spam.com (MONTARD)</author><pubDate><![CDATA[Thu, 23 Jul 2009 07:58:19 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment357</guid></item><item><title><![CDATA[Comment #8 (Reply to Comment #7)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment367</link><description><![CDATA[The XML API in this case will return an empty data.
The &quot;SUCCESS&quot; indicate that you have successfully made a request to the API

The API can return the following string in it&#039;s data:
- Nothing (if subscriber is not in the list)
- A number -- the subscriberid (this is the default)
- An XML -- it will contains listid and subscriberid element

So please check the DATA element instead of the STATUS element.<br/><br/>
(Comment posted by hendri at 1:12 am, Mon 27th Jul 2009)]]></description><author>no@spam.com (hendri)</author><pubDate><![CDATA[Mon, 27 Jul 2009 01:12:31 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment367</guid></item><item><title><![CDATA[Comment #9]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment361</link><description><![CDATA[I wonder if there&#039;s API that can be use to wrapped email marketer within a CMS.  so if i have client, they don&#039;t have to use two seperate login page...<br/><br/>
(Comment posted by Vic at 12:20 am, Sat 25th Jul 2009)]]></description><author>no@spam.com (Vic)</author><pubDate><![CDATA[Sat, 25 Jul 2009 00:20:50 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment361</guid></item><item><title><![CDATA[Comment #10 (Reply to Comment #9)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment366</link><description><![CDATA[Try this (put it in admin directory) ... I&#039;m not sure if it works (since I haven&#039;t test them out yet):

&lt;?php
define(&#039;IEM_NO_CONTROLLER&#039;, true);
require_once(dirname(__FILE__) . &#039;/index.php&#039;);

IEM::sessionLoginWithID(&lt;USERID&gt;);

// After this, you are already logged in, so
// you are free to re-direct user to IEM

IEM::redirectTo(&#039;index&#039;);
exit();
?&gt;


Also please note that the above code will not work in future use. It will only work for IEM 5.7.x ...
<br/><br/>
(Comment posted by hendri at 1:03 am, Mon 27th Jul 2009)]]></description><author>no@spam.com (hendri)</author><pubDate><![CDATA[Mon, 27 Jul 2009 01:03:47 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment366</guid></item><item><title><![CDATA[Comment #10 (Reply to Comment #9)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment374</link><description><![CDATA[Hendri,
Why will this code not work in the future? I am using the php API with IEM 5.7.x. Will it also not work in the future?

		// Make sure that the IEM controller does NOT redirect request.
		if (!defined(&#039;IEM_NO_CONTROLLER&#039;)) {
			define(&#039;IEM_NO_CONTROLLER&#039;, true);
		}
		
		/**
		* Require base sendstudio functionality. This connects to the database, sets up our base paths and so on.
		*/
		require_once dirname(__FILE__) . &#039;/admin/index.php&#039;;
		
		/**
		* This file lets us get api&#039;s, load language files and parse templates.
		*/
		require_once(SENDSTUDIO_FUNCTION_DIRECTORY . &#039;/sendstudio_functions.php&#039;);
		
		$this-&gt;sendstudio_functions = new Sendstudio_Functions();
		
		$this-&gt;subscriberapi = $this-&gt;sendstudio_functions-&gt;GetApi(&#039;Subscribers&#039;);

Thanks,
Jesse<br/><br/>
(Comment posted by Jesse at 5:59 am, Thu 30th Jul 2009)]]></description><author>no@spam.com (Jesse)</author><pubDate><![CDATA[Thu, 30 Jul 2009 05:59:17 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment374</guid></item><item><title><![CDATA[Comment #10 (Reply to Comment #9)]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment375</link><description><![CDATA[Hi Jesse this particular code: 

IEM::sessionLoginWithID(&lt;USERID&gt;);

Will no longer be used in IEM 5.8, but if there are a lot of people utilizing the code, we might keep the function as an interface. (It&#039;s just a simple method name change).

The new method will be (this is for *planned* IEM 5.8 or above):

IEM::userLogin(&lt;USERID&gt;)

The code that you sent above will still be working correctly.
<br/><br/>
(Comment posted by hendri at 6:30 pm, Thu 30th Jul 2009)]]></description><author>no@spam.com (hendri)</author><pubDate><![CDATA[Thu, 30 Jul 2009 18:30:49 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment375</guid></item><item><title><![CDATA[Comment #13]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment365</link><description><![CDATA[@Max Schwanekamp 

You must use the correct ordering with many of these or they will fail. The code uses item[0], item[1], etc as the parameters rather than taking the time to map the keyed XML values into the function parameters.<br/><br/>
(Comment posted by Alan at 12:51 am, Mon 27th Jul 2009)]]></description><author>no@spam.com (Alan)</author><pubDate><![CDATA[Mon, 27 Jul 2009 00:51:00 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment365</guid></item><item><title><![CDATA[Comment #14]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment379</link><description><![CDATA[Hello, I am writting a Flex application and trying to post to the XML API to insert a new user. I come from a ColdFusion background and one thing that is not clear to be looking at the PHP examples, is what POST formfield should the XML data be embeded in? Or am I missing something? As it stands now I keep getting the following responce back from the server: the XML you provided is not valid. Please check your XML document and try again. However the XML is copied right from your example and appears to be in good form. Thanks<br/><br/>
(Comment posted by Bill at 10:37 pm, Wed 5th Aug 2009)]]></description><author>no@spam.com (Bill)</author><pubDate><![CDATA[Wed, 05 Aug 2009 22:37:21 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment379</guid></item><item><title><![CDATA[Comment #15]]></title><link>http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment380</link><description><![CDATA[Found the answer to my last question about how the data needs to be sent in a Flex application,
The key was is contentType=&quot;application/xml&quot; as in:

&lt;mx:HTTPService id=&quot;AddSubscriberToList&quot; 
	            method=&quot;POST&quot; 
	            resultFormat=&quot;text&quot;
	            contentType=&quot;application/xml&quot;
	            useProxy=&quot;false&quot;
                 url=&quot;http://somedomain.com/xml.php&quot; 
                result=&quot;AddSubscriberResult(event)&quot;/&gt;<br/><br/>
(Comment posted by Bill at 11:40 pm, Wed 5th Aug 2009)]]></description><author>no@spam.com (Bill)</author><pubDate><![CDATA[Wed, 05 Aug 2009 23:40:50 CDT]]></pubDate><guid isPermaLink="true">http://idn.interspire.com/articles/27/1/Interspire-Email-Marketer-XML-API-Documentation/Page1.html#Comment380</guid></item></channel></rss>