PHP Wrapper

For Premium and Deluxe customers we provide an API on the basis of the programming paradigm REST (Representational State Transfer). With this you can easily implement KlickTipp into any system.

The API enables the access to information on KlickTipp. In addition to that, you can update your KlickTipp contact data through your web application. For example, using our API you can assign the tag “Kunde” (“customer”) to a customer that bought a certain product through your shop system. This way you can put all of the email marketing functions of KlickTipp to use for your customer.

We provide you our API as REST web service. This way you can access your files with the programming language of your choice, for example PHP, Javascript or XML.

PHP Interface Class

To help you ease your way into programming, we wrote out some interface class in PHP for you.

Simply download the class here :

Afterwards, upload the class via FTP to your web server into the directory in which you want to use the API.

Function

Now we want to describe the functions of the class in more detail.

To access a recipient’s data, you have to first log into the API with your username and password by using the function login The login will be saved in the session.

After that, execute the desired function. You can also execute multiple APIs in sequence without having to re-log each time. After having executed the function, log out from the API using the function logout .

Starting up the API always works the same way:

<?php

require ('klicktipp.api.inc');

$connector = new KlicktippConnector();
$connector->login('username', 'password');

// Insert api function here
$result = $connector->apifunction($parameters);

$connector->logout();

?>
					

Instead of $connector->apifunction($parameters); use one of the functions listed below.

Functions

In our API you have the following functions at your disposal.

login($username, $password)

With this function you log in with you username $username and your password $password into your KlickTipp account.

  • param mixed $username – Your KlickTipp username
  • param mixed $password – Your KlickTipp password

The function will TRUE return TRUE if the login was successful.

Example

<?php

/**
 * Login
 * 
 * @param mixed $username
 * @param mixed $password
 * 
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password

$connector = new KlicktippConnector();
$logged_in = $connector->login($username, $password);
$connector->logout();

if ($logged_in) {
  print 'Login successful.';
} else {
  print $connector->get_last_error();
}

?>
					

logout()

With this function you log out of your KlickTipp account.

The function will TRUE return TRUE if the login was successful.

Example

<?php

/**
 * Log out the user that is currently logged in.
 * 
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password

$connector = new KlicktippConnector();
$connector->login($username, $password);
$logged_out = $connector->logout();

if ($logged_out) {
  print 'Logout successful.';
} else {
  print $connector->get_last_error();
}

?>
					

subscriber_index()

This function will return an associative array [id] => [subscriber_id] of all contacts in your KlickTipp account. You have to login with login in order to be able to use this function.

Example

<?php

/**
 * Get all active subscribers. Login required.
 * 
 * @return array [subscriber_id]
 * Use subscriber_get to get subscriber details.
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscriber_ids = $connector->subscriber_index();
$connector->logout();

if ($subscriber_ids) {
  print_r($subscriber_ids, true);
} else {
  print $connector->get_last_error();
}

?>
					

subscriber_tagged($tag_id)

With this function you can search for recipients who have been tagged with a certain tag. You have to login with login in order to be able to use this function.

  • param mixed $tag_id – ID of the tag

The function returns an associative array [subscriber_id] => [subscription_timestamp] zurück. Use the function subscriber_get to read the data of a specific recipient.

Example

<?php

/**
 * Get all active subscribers tagged with the given tag id. Login required.
 * 
 * @param mixed $tag_id
 * 
 * @return array [subscriber_id] => [subscription_timestamp]
 * Use subscriber_get to get subscriber details.
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$tag_id = 123; // Replace 123 with the tag id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscriber = $connector->subscriber_tagged($tag_id);
$connector->logout();

if ($subscriber) {
  print_r($subscriber, true);
} else {
  print $connector->get_last_error();
}

?>
					

subscriber_search($email_address)

With this function you can search for a recipient in your KlickTipp account using the email address. You have to login with login in order to be able to use this function.

  • param mixed $email_address – the recipients email address

The function will return the recipients ID. Use the function subscriber_get to read the data of a specific recipient.

Example

<?php

/**
 * Get subscriber id by email address. Login required.
 * 
 * @param mixed $email_address
 * 
 * @return The id of the subscriber.
 * Use subscriber_get to get subscriber details.
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$email_address = 'emailaddress@domain.com'; // Replace with the email address.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscriber_id = $connector->subscriber_search($email_address);
$connector->logout();

if ($subscriber_id) {
  print $subscriber_id;
} else {
  print $connector->get_last_error();
}

?>
					

subscriber_get($subscriber_id)

With this function you can read out all information on a recipient. You can use this function, for example, in order to find out when a contact has received, opened, or clicked on a link in an email. You have to login with login in order to be able to use this function.

  • param mixed $subscriber_id – recipient’s ID

The function will return an object with the recipient’s data. The content of all fields as well as the associative arrays of the tags, with which the recipient has been tagged, will be listed:

  • manual_tags – associative Array manual tags [tag_id] => [timestamp]
  • smart_links – associative Array SmartLinks [tag_id] => [timestamp]
  • emails_sent – associative Array „Newsletter / Autoresponder erhalten“ [Newsletter / Autoresponder ID] => [timestamp]
  • emails_opened – associative Array „Newsletter / Autoresponder geklickt“ [Newsletter / Autoresponder ID] => [timestamp]
  • emails_clicked – associative Array „Newsletter / Autoresponder geöffnet“ [Newsletter / Autoresponder ID] => [timestamp]
  • emails_viewed – associative Array „Newsletter / Autoresponder im Webbrowser angesehen“ [Newsletter / Autoresponder ID] => [timestamp]
  • conversions – associative Array „Newsletter / Autoresponder Conversion-Pixel geladen“ [Newsletter / Autoresponder ID] => [timestamp]
  • outbound – associative Array „Outbound ausgelöst“ [Outbound ID] => [timestamp]
  • kajabi_activated – associative Array „Kajabi Membership aktiviert“ [Kajabi ID] => [timestamp]
  • kajabi_deactivated – associative Array „Kajabi Membership deaktiviert“ [Outbound ID] => [timestamp]
  • taggingpixel_triggered – associative Array „Tagging-Pixel ausgelöst“ [Tagging-Pixel ID] => [timestamp]
  • notification_emails_sent – associative Array „Email (Marketing Cockpit) erhalten“ [Email ID] => [timestamp]
  • notification_emails_opened – associative Array „Email (Marketing Cockpit) geöffnet“ [Email ID] => [timestamp]
  • notification_emails_clicked – associative Array „Email (Marketing Cockpit) geklickt“ [Email ID] => [timestamp]
  • notification_emails_viewed – associative Array „Email (Marketing Cockpit) im Webbrowser angesehen“ [Email ID] => [timestamp]
  • notification_sms_sent – associative Array „SMS (Marketing Cockpit) erhalten“ [SMS ID] => [timestamp]
  • notification_sms_clicked – associative Array „SMS (Marketing Cockpit) geklickt“ [SMS ID] => [timestamp]
  • campaigns_started – associative Array „Kampagne gestartet“ [Kampagnen ID] => [timestamp]
  • campaigns_finished – associative Array „Kampagne beendet“ [Kampagnen ID] => [timestamp]
  • api_subscriptions – associative Array „Via API-Key eingetragen“ [API-Key ID] => [timestamp]
  • email_subscriptions – associative Array „Via E-Mail eingetragen“ [Eintragung-per-E-Mail ID] => [timestamp]
  • sms_subscriptions – associative Array „Via SMS eingetragen“ [Eintragung-per-SMS ID] => [timestamp]
  • form_subscriptions – associative Array „Via Anmeldeformular“ [Anmeldeformular ID] => [timestamp]
  • facebook_subscriptions – associative Array „Via Facebook-Button eingetragen“ [Facebook-Button ID] => [timestamp]
  • payments – associative Array „Zahlung eingegangen“ [Produkt ID] => [timestamp]
  • refunds – associative Array „Rückzahlung ausgelöst“ [Produkt ID] => [timestamp]
  • chargebacks – associative Array „Chargeback ausgelöst“ [Produkt ID] => [timestamp]
  • rebills_canceled – associative Array „Abo gekündigt“ [Produkt ID] => [timestamp]
  • rebills_resumed – associative Array „Abo wiederaufgenommen“ [Produkt ID] => [timestamp]
  • rebills_expired – associative Array „Letzten Tag des Abo erreicht“ [Produkt ID] => [timestamp]
  • digistore_affiliations – associative Array „Affiliate eines Digistore24-Produkts“ [Produkt ID] => [timestamp]

You can find the IDs of the corresponding emails, signup forms, products, etc. in the first column of the table of the corresponding overview page.

Example

<?php

/**
 * Get subscriber information. Login required.
 * 
 * @param mixed $subscriber_id
 * 
 * @return subscriber object
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$subscriber_id = 123; // Replace 123 with the subscriber id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscriber = $connector->subscriber_get($subscriber_id);
$connector->logout();

if ($subscriber) {
  print_r($subscriber, true);
} else {
  print $connector->get_last_error();
}

?>
					

subscribe($email_address, $list_id = 0, $tag_id = 0, $fields = array(), $smsnumber = '')

With this function you can enter a new subscriber to your ContactCloud. You have to login with login in order to be able to use this function.

  • param mixed $email_address – recipient’s email address
  • param mixed $list_id – optional: ID of the double-opt-in process (open the menu “Automatisierung” and choose “Double-Opt-In-Prozesse.” You will find the ID at the top of the table.
  • param mixed $tag_id – optional: ID of the tag with which you contact has been tagged. (open the menu “Automatisierung” and choose the option “Tags”. You will find the ID at the top of the table.
  • param mixed $fields – optional: additional data of the recipient, for example, name, affiliate ID, address, customer number etc. The array must be constructed in the same way as the output of the function field_index .
  • param mixed $smsnumber – optional: recipient’s SMS mobile number.

The function returns an object with the recipient’s data.

Example

<?php

/**
 * Add subscriber. Login required.
 * 
 * @param mixed $email_email address
 * @param mixed $subscription_process (optional)
 * @param mixed $tag_id (optional)
 * @param mixed $fields (optional)
 * @param mixed $smsnumber (optional)
 * 
 * @return subscriber object
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$email_address = 'emailaddress@domain.com'; // Replace with the email address.
$double_optin_process_id = 123;
  // Replace 123 with the id of the double optin prozesses.
$tag_id = 456; // Replace 456 with the tag id.
$fields = array ( // Use field_index to get all custom fields.
  'fieldFirstName' => 'Thomas',
  'fieldLastName' => 'Weber',
);
$smsnumber = '00491631737743';

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscriber = $connector->subscribe($email_address,
$double_optin_process_id, $tag_id, $fields, $smsnumber);
$connector->logout();

if ($subscriber) {
  print_r($subscriber, true);
} else {
  print $connector->get_last_error();
}

?>
					

signin($api_key, $email_address, $fields = array(), $smsnumber = '')

With this function you can add a new subscriber to you ContactCloud using an API key.

  • param mixed $api_key – API key
  • param mixed $email_address – recipient’s email address
  • param mixed $fields – optional: additional data of the recipient, for example, name, affiliate ID, address, customer number etc. The array must be constructed in the same way as the output of the function field_index .
  • param mixed $smsnumber – optional: recipient’s SMS mobile number

The function returns the URL of the double opt-in process’ confirmation page which is used in the API key.

Example

<?php

/**
 * Add subscriber. API Key required.
 * 
 * @param mixed $api_key
 * @param mixed $email_address
 * @param mixed $fields (optional)
 * @param mixed $smsnumber (optional)
 * 
 * @return redirect url as defined in the subscription process used in the API Key.
 */

require ('klicktipp.api.inc');

$api_key = '123xyz'; // Replace 123xyz with the api key.
$email_address = 'emailaddress@domain.com'; // Replace with the email address.
$fields = array ( // Use field_index to get all custom fields.
  'fieldFirstName' => 'Thomas',
  'fieldLastName' => 'Weber',
);
$smsnumber = '00491631737743';

$connector = new KlicktippConnector();
$redirect_url = $connector->signin($api_key, $email_address, $fields, $smsnumber);

if ($redirect_url) {
  print $redirect_url;
} else {
  print $connector->get_last_error();
}

?>
					

subscriber_update($subscriber_id, $fields = array(), $newemail = '', $newsmsnumber = '')

With this function you can update a recipient’s data. You have to login with login in order to be able to use this function.

  • param mixed $subscriber_id – recipient’s ID
  • param mixed $fields – fields that need to be updated
  • param mixed $newemail – optional: recipient’s new email address
  • param mixed $newsmsnumber – optional: recipient’s new SMS mobile number

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Update subscriber. Login required.
 * 
 * @param mixed $subscriber_id
 * @param mixed $fields (optional)
 * @param mixed $newemail (optional)
 * @param mixed $newsmsnumber (optional)
 * 
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$subscriber_id = 123; // Replace 123 with the subscriber id.
$newemail = 'newemailaddress@domain.com';
  // Replace with the new email address.
$fields = array ( // Use field_index to get all custom fields.
  'fieldFirstName' => 'Martin',
  'fieldLastName' => 'Meier',
);
$newsmsnumber = '00491631737743';

$connector = new KlicktippConnector();
$connector->login($username, $password);
$updated = $connector->subscriber_update($subscriber_id, $fields, $newemail, $newsmsnumber);
$connector->logout();

if ($updated) {
  print 'Subscriber successfully updated.';
} else {
  print $connector->get_last_error();
}

?>
					

tag($email_address, $tag_id)

With this function you can assign manual tags or SmartLinks to a contact. You have to login with login in order to be able to use this function.

  • param mixed $email_address – recipient’s email address
  • param mixed $tag_id – the ID of the manual tags/ SmartLinks. You can also transfer an array of tag IDs in order to assign multiple tags simultaneously (Open the menu “Automatisierung” and choose the option “Tags” or “SmartLinks”. You will find the ID at the top of the table).

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Tag subscriber. Login required.
 *
 * @param mixed $email_address
 * @param mixed $tag_id
 *
 * @return subscriber object
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$email_address = 'emailaddress@domain.com'; // Replace with the email address.
$tag_id = 123; // Replace 123 with the tag id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$result = $connector->tag($email_address, $tag_id);
$connector->logout();

if ($result) {
  print 'Subscriber successfully tagged.';
} else {
  print $connector->get_last_error();
}

?>
					

untag($email_address, $tag_id)

With this function you can remove a manual tag or a SmartLink from a contact. You have to login with login in order to be able to use this function.

  • param mixed $email_address – recipient’s email address
  • param mixed $tag_id – the ID of the manual tags/ SmartLinks. You can also transfer an array of tag IDs in order to assign multiple tags simultaneously (Open the menu “Automatisierung” and choose the option “Tags” or “SmartLinks”. You will find the ID at the top of the table).

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Remove tag from subscriber. Login required.
 *
 * @param mixed $email_address
 * @param mixed $tag_id
 *
 * @return TRUE on success.
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$email_address = 'emailaddress@domain.com'; // Replace with the email address.
$tag_id = 123; // Replace 123 with the tag id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$untagged = $connector->untag($email_address, $tag_id);
$connector->logout();

if ($untagged) {
  print 'Tag successfully removed from subscriber.';
} else {
  print $connector->get_last_error();
}

?>

signout($api_key, $email_address)

With this function you can remove a manual tag or SmartLink with the API key from a contact.

  • param mixed $api_key – API key
  • param mixed $email_address – recipient’s email address

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Remove tag from subscriber. API Key required.
 *
 * @param mixed $api_key
 * @param mixed $email_address
 *
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$api_key = '123xyz'; // Replace 123xyz with the api key.
$email_address = 'emailaddress@domain.com'; // Replace with the email address.

$connector = new KlicktippConnector();
$untagged = $connector->signout($api_key, $email_address);

if ($untagged) {
  print 'Tag successfully removed from subscriber.';
} else {
  print $connector->get_last_error();
}

?>
					

unsubscribe($email_address)

With this function you can unsubscribe a recipient. You have to login with login in order to be able to use this function.

  • param mixed $email_address – recipient’s email address

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Unsubscribe subscriber. Login required.
 *
 * @param mixed $email_address
 *
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$email_address = 'emailaddress@domain.com'; // Replace with the email address.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$unsubscribed = $connector->unsubscribe($email_address);
$connector->logout();

if ($unsubscribed) {
  print 'Subscriber successfully unsubscribed.';
} else {
  print $connector->get_last_error();
}

?>
					

signoff($api_key, $email_address)

With this function you can unsubscribe a recipient with an API key.

  • param mixed $api_key – API key
  • param mixed $email_address – recipient’s email address

The function will return TRUE if the process was successful.

Beispiel

<?php

/**
 * Unsubscribe subscriber. API Key required.
 *
 * @param mixed $api_key
 * @param mixed $email_address
 *
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$api_key = '123xyz'; // Replace 123xyz with the api key.
$email_address = 'emailaddress@domain.com'; // Replace with the email address.

$connector = new KlicktippConnector();
$unsubscribed = $connector->signoff($api_key, $email_address);

if ($unsubscribed) {
  print 'Subscriber successfully unsubscribed.';
} else {
  print $connector->get_last_error();
}

?>
					

subscriber_delete($subscriber_id)

With this function you can delete a recipient. You have to login with login in order to be able to use this function.

  • param mixed $subscriber_id – recipient’s ID

The function will return TRUE if the process was successful.

<?php

/**
 * Delete subscriber. Login required.
 *
 * @param mixed $subscriber_id
 *
 * @return TRUE on success.
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$subscriber_id = 123; // Replace 123 with the subscriber id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$deleted = $connector->subscriber_delete($subscriber_id);
$connector->logout();

if ($deleted) {
  print 'Subscriber successfully deleted.';
} else {
  print $connector->get_last_error();
}

?>
					

tag_index()

This function returns an associative array [tag_id] => [tag_name] of your manual tags and SmartLinks. You have to login with login in order to be able to use this function.

Beispiel

<?php

/**
 * Get all manual tags and smart links of the user. Login required.
 *
 * @return array [tag_id] => [tag_name]
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password

$connector = new KlicktippConnector();
$connector->login($username, $password);
$tags = $connector->tag_index();
$connector->logout();

if ($tags) {
  print_r($tags, true);
} else {
  print $connector->get_last_error();
}

?>
					

tag_get($tag_id)

This function returns the name and description of a tag. You have to login with login in order to be able to use this function.

  • param mixed $tag_id – tag’s ID

Beispiel

<?php

/**
 * Get tag definition. Login required.
 *
 * @param mixed $tag_id
 *
 * @return tag object
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$tag_id = 123; // Replace 123 with the tag id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$tag = $connector->tag_get($tag_id);
$connector->logout();

if ($tag) {
   print_r($tag, true);
} else {
  print $connector->get_last_error();
}

?>
					

tag_create($name, $text = '')

With this function you can create a new manual tag. You have to login with login in order to be able to use this function.

  • param mixed $name – name of the manual tag
  • param mixed $text – optional: additional information

The function returns the ID of the new tag.

Example

<?php

/**
 * Create manual tag. Login required.
 *
 * @param string $name (name of the tag)
 * @param mixed $text (optional: additional information)
 *
 * @return mixed tag id of the new tag
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$name = 'Tag 123';
$text = 'Further information ...';

$connector = new KlicktippConnector();
$connector->login($username, $password);
$tag_id = $connector->tag_create($name, $text);
$connector->logout();

if ($tag_id) {
  print $tag_id;
} else {
  print $connector->get_last_error();
}

?>
					

tag_update($tag_id, $name = '', $text = '')

With this function you can update manual tags and SmartLinks. You have to login with login in order to be able to use this function.

  • param mixed $tag_id – the ID of the manual tags/ SmartLinks. You can also transfer an array of tag IDs in order to assign multiple tags simultaneously (Open the menu “Automatisierung” and choose the option “Tags” or “SmartLinks”. You will find the ID at the top of the table).
  • param mixed $name – optional: name of the manual tag/ SmartLink
  • param mixed $text – optional: additional information

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Update tag. Login required.
 *
 * @param mixed $tag_id
 * @param mixed $name (optional: New tag name. Set empty to leave unchanged.)
 * @param mixed $text (optional: New tag description. Set empty to leave unchanged.)
 *
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$tag_id = 123; // Replace 123 with the tag id.
$name = 'Tag 123';
$text = 'Further information ...';

$connector = new KlicktippConnector();
$connector->login($username, $password);
$updated = $connector->tag_update($tag_id, $name, $text);
$connector->logout();

if ($updated) {
  print 'Tag successfully updated.';
} else {
  print $connector->get_last_error();
}

?>
					

tag_delete($tag_id)

With this function you can delete a manual tag or SmartLink. You have to login with login in order to be able to use this function.

  • param mixed $tag_id – the ID of the manual tags/ SmartLinks. You can also transfer an array of tag IDs in order to assign multiple tags simultaneously (Open the menu “Automatisierung” and choose the option “Tags” or “SmartLinks”. You will find the ID at the top of the table).

The function will return TRUE if the process was successful.

Example

<?php

/**
 * Delete tag. Login required.
 *
 * @param mixed $tag_id
 *
 * @return TRUE on success
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$tag_id = 290347; // Replace 123 with the tag id.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$deleted = $connector->tag_delete($tag_id);
$connector->logout();

if ($deleted) {
  print 'Tag successfully deleted.';
} else {
  print $connector->get_last_error();
}

?>
					

subscription_process_index()

This function returns an associative array [double_optin_process_id] => [double_optin_process_name] of your double opt-in process. You have to login with login in order to be able to use this function.

Example

<?php

/**
 * Get all double optin processes. Login required.
 *
 * @return array [double_optin_process_id] => [double_optin_process_name]
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscription_processes = $connector->subscription_process_index();
$connector->logout();

if ($subscription_processes) {
  print_r($subscription_processes, true);
} else {
  print $connector->get_last_error();
}

?>
					

subscription_process_get($list_id)

This function returns the name of a double opt-in process. You have to login with login in order to be able to use this function.

  • param mixed $list_id – optional: ID of the double-opt-in process (open the menu “Automatisierung” and choose “Double-Opt-In-Prozesse.” You will find the ID at the top of the table).

Example

<?php

/**
 * Get double optin process definition. Login required.
 *
 * @param mixed $double_optin_process_id
 *
 * @return double optin process object
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$double_optin_process_id = 123; // Replace 123 with the id of the double optin prozesses.

$connector = new KlicktippConnector();
$connector->login($username, $password);
$subscription_process = $connector->subscription_process_get($double_optin_process_id);
$connector->logout();

if ($subscription_process) {
  print_r($subscription_processes, true);
} else {
  print $connector->get_last_error();
}

?>
					

subscription_process_redirect($listid, $email)

With this function you get the URL of the double opt-in process’ confirmation page for a specific recipient.

  • param mixed $listid – ID of the double-opt-in process (open the menu “Automatisierung” and choose “Double-Opt-In-Prozesse”. You will find the ID at the top of the table).
  • param mixed $email – recipient’s email address

This function returns the URL of the double opt-in process’ confirmation page for the specific recipient.

Example

<?php

/**
* Get double optin process redirect url. Login required.
*
* @param mixed $listid
* @param mixed $email
*
* @return redirect url as defined in the subscription process.
*/

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password
$double_optin_process_id = 123; // Replace 123 with the id of the double optin process.
$email = 'emailaddress@domain.com'; // Replace with the email address.

$connector = new KlicktippConnector();
$redirect_url = $connector->subscription_process_redirect($double_optin_process_id, $email);

if ($redirect_url) {
  print $redirect_url;
} else {
  print $connector->get_last_error();
}

?>
					

field_index()

This function returns an associative array [field_identifier] => [field_name] of the fields in your ContactCloud. You have to login with login in order to be able to use this function.

Example

<?php

/**
 * Get all contact fields. Login required.
 *
 * @return array [field_identifier] => [field_name]
 */

require ('klicktipp.api.inc');

$username = 'username'; // Replace with username
$password = 'password'; // Replace with password

$connector = new KlicktippConnector();
$connector->login($username, $password);
$fields = $connector->field_index();
$connector->logout();

if ($fields) {
  print_r($fields, true);
} else {
  print $connector->get_last_error();
}

?>
					

Hat dieser Beitrag Dir weitergeholfen?