Forums

Chronoforms and some API available via SOAP over HTTP calls

zeroc00l 09 Apr, 2013
Hi all, I'm an happy user of Chronoforms, I make almost everything with it that has a form creation behind.
My problem now is that I must integrate a mail marketing platform to my forms, when a user check the "Newsletter" box I want to link at this mail marketing program using its API available via SOAP. I have the manual of that program, but perhaps it's out of my boundaries of knowledge about Joomla and Chronoforms.

Someone has ever had experience about this problem?

PS: Sorry for my English.
GreyHead 09 Apr, 2013
Hi zeroc00l,

Which mail marketing program are you trying to link to? There are examples in the FAQs or the forums for a few of the common Joomla! ones.

I have only a little experience using SOAP with ChronoForms - it isn't always necessary.

Bob
zeroc00l 09 Apr, 2013
Hi Greyhound, thank you for the reply primarly.

Secondly, I can tell you that the mail marketing program is made, here, in Italy, http://www.contactlab.com/ is the provider and producer, I don't know if their platform is propritary of them or is just an implementation for the italian market of some global software.

I have just a manual they gave to me that speak about "API available via SOAP over HTTP calls", and really, this scared me initially.

Then after some breath I realized that essentially I must make some calls from HTTP after the call of the API, this is realizable by a fantastic Google search, I presume, but my question remains, how can I integrate some Chronoform forms, with a check in a field, call it "Newsletter", and put some code that can help me to realize this integration?

Obviously it's reasonable that perhaps this is not a right request on this forum, but, I don't know where to go, I realized every form with your awesome component, but now I'm stucked.

:(

If there is somebody out there that realized something similar is welcome.
GreyHead 10 Apr, 2013
Hi zerox001,

I registered on the Contact Lab site and tried to get the English language version of the manual but just went round in circles, I suspect it is only available to customers :-(

Usually there are several parts to this kind of transaction.

a) you need to re-format the data to send it to ContactLab, you can do this using s Custom Code action in the form On Submit event.

2) you need to send the data, usually the cURL action will let you do this.

3) You may need to handle a response from ContactLab, this requires more custom code, usually in a new form event.

Sorry to be a bit vague, if you can get the manual in English and email me a copy I can give you a bit more detail.

Bob
zeroc00l 10 Apr, 2013
Meanwhile I'm searching and trying something, but until now, nothing of serious.....I tried to send you a PM, but the attachement is about 1,6MB and PM accept just files below 256 KiB.
zeroc00l 10 Apr, 2013
Hi, it's me again🙂

Sorry for the lack of replies, but I've been very busy....:(

Perhaps I found a solution that solution is the magic of HTTP Request, let me explain.

I found on the old site of my customer that direct link to the newsletter subrscribe page of COntactLab: http://clientsection.contactlab.it/service/subscribe.php?g=2001345&wfc=220013456665

As you can see analyzing the HTML code, you can find, as normal, an action url for the form,
if I compile the HTTP Request pointing to that url on my chronoforms, and try to replicate the fields of the orignal form, something would happen...?_?

PS: I just tried something but perhaps I don't know how to correctly compile the fields of HTTP Request or I misunderstandig something
zeroc00l 18 Apr, 2013
Hi all, nobody knows how can I compile correctly the Event HTTP Request?

Just this to make some tests.
GreyHead 22 Apr, 2013
Hi zeroc001,

I've never used this action and don't know any more than is in the action help. What have you tried and what isn't working?

Bob
zeroc00l 02 May, 2013
Hi Bob, I have some updates, forget everything I said except the part about the manuals I get from COntactLab.

I analyzed better the code they sent me, and perhaps a solution is just include the code about the "addSubscriber" procedure, I paste the code here for better explanations:

<?php

// This example needs to be filled with proper values.
// Please read the documentation for further information.

require_once(dirname(__FILE__)."/../client/ClabService.php");

$clabService = new ClabService();


try {
	$clabService = new ClabService();

	$btoken = new borrowToken();

	$btoken->apiKey = INSERT YOUR API KEY HERE;
	$btoken->userKey = INSERT YOUR USER KEY HERE;
	$token = $clabService->borrowToken($btoken)->return;

	/*
	 * prepare data structure
	*/

	$attribute = new SubscriberAttribute();
	$attribute->key = <<a key name>>;
	$attribute->value = new SoapVar(<<a value>>,XSD_ANYTYPE,'string','http://www.w3.org/2001/XMLSchema','value');
	$attributes[] = $attribute;

	$attribute = new SubscriberAttribute();
	$attribute->key = <<a key name>>;
	$attribute->value = new SoapVar(<<a value>>,XSD_ANYTYPE,'string','http://www.w3.org/2001/XMLSchema','value');
	$attributes[] = $attribute;

	$subscriber = new Subscriber();
	$subscriber->identifier = null;
	$subscriber->attributes = $attributes;


	$addSub = new addSubscriber();
	$addSub->token = $token;
	$addSub->subscriber = $subscriber;

	$addSub->sourceIdentifier = << a source identifier>>;
	$ret = $clabService->addSubscriber($addSub);

	echo "Subscriber ".$ret->return->attributes[0]->value." successfully added with ID: ".$ret->return->identifier;

	//var_dump($ret);
} catch (SOAPFault $f) {
var_dump($f);
}
?>


As you can see there are some fields to be filled like API KEY e USER KEY, I have those keys.
At the very start of this code you can see also this
"require_once(dirname(__FILE__)."/../client/ClabService.php");"
I have those folder with a bunch of PHP files, in which i found also CalbService.php.

Now, my question is, I uploaded that folder with those files on my server, in the root of the site, I want to access it and I must change this path, obviously, "require_once(dirname(__FILE__)."/../client/ClabService.php");"
In your opinion a form created with Chronoforms, where is located form the root of my site?

Than the second answer is, how can I use that code in my forms at the event OnSubmit? I tried the element "CustomCode" but strangely it doesn't do anything, if I write simply a php that echoes something it does the job, print something, instead if I wirte that code , nothing happens, also a simply echo doesn't do anything.

Thanks again
This topic is locked and no more replies can be posted.