Skip to content

PHP class for using our company API as part of the subscription

Notifications You must be signed in to change notification settings

emailplatform/ApiParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

ApiParser

PHP class for using our company's API as part of the subscription.



Installation

Run following command in terminal from the root of your project:

composer require emailplatform/api_parser

You can load dependencies by adding these lines to your code:

require_once 'vendor/emailplatform/api_parser/src/settings.php';
require_once 'vendor/emailplatform/api_parser/src/ApiParser.class.php';


How to use

  1. Set up your API credentials (apiusername & apitoken) into settings.php
  2. Create instance from ApiParser.class.php
$parser = new ApiParser($settings);
  1. Call method from ApiParser
$subscriberid = 68317547;
$listid = 0;
$emailaddress = "";
$mobileNumenr = "";
$mobilePrefix = "";
$fieldid = 14;
$fieldValue = array(
   'Lastname' => "Tom",
   'Firstname' => 'Jones',
   'Date' => '31-12-2020 T00:00',
   'Active' => 0
);
$path = 'Users[Lastname=SimpleChange4]';

$result = $parser->UpdateOTMDocument($subscriberid, $listid, $emailaddress, $mobileNumber, $mobilePrefix, $fieldid, $fieldValue, $path);

print_r($result);


Changelog:

Differences between v1.2.21 and v1.2.22

Method definition changed:

  • ChangeMobile

Now:

$Mobile no longer require parameters

Differences between v1.2.19 and v1.2.21

Method definition changed:

  • ScheduleSendSMS

*Previous:

public function ScheduleSendSMS($campaignid = false, $lists = false, $hours = false)

Now:

public function ScheduleSendSMS($campaignid = false, $hours = false)

Differences between v1.2.16 and v1.2.17

Method definition changed:

  • UpdateOTMDocument

Previous:

public function UpdateOTMDocument ($subscriberid = 0, $fieldid = 0, $fieldValueOTM = array(), $path = "")

Now:

public function UpdateOTMDocument ($subscriberid = 0, $listid = 0, $emailaddress = "", $mobileNumber = "", $mobilePrefix = "", $fieldid = 0, $fieldValueOTM = array(), $path = "")
  • Added: listid, emailaddress, mobileNumber and mobilePrefix.

Differences between v1.2.15 and v1.2.16

Method definition changed:

  • GetSubscriberDetails

Previous: listid was required.

Now: listid is not required if subscriberid is specified.

Differences between v1.2.14 and v1.2.15

Method definition changed:

  • ScheduleSendNewsletter

Previous:

public function ScheduleSendNewsletter($campaignid = false, $hours = false, $saveSnapshots = true, $reloadFeed = true)

Now:

public function ScheduleSendNewsletter($campaignid = false, $hours = false, $saveSnapshots = true, $reloadFeed = true, $notifyOwner = false)
  • Added: notifyOwner

  • ScheduleSendNewsletterToLists

Previous:

public function ScheduleSendNewsletterToLists($newsletterid = false, $timeToSend = false, $listids = array(), $saveSnapshots = true, $reloadFeed = true)

Now:

public function ScheduleSendNewsletterToLists($newsletterid = false, $timeToSend = false, $listids = array(), $saveSnapshots = true, $reloadFeed = true, $notifyOwner = false)
  • Added: notifyOwner

  • ScheduleSendNewsletterToSegments

Previous:

public function ScheduleSendNewsletterToSegments($newsletterid = false, $timeToSend = false, $segmentids = array(), $saveSnapshots = true, $reloadFeed = true)

Now:

public function ScheduleSendNewsletterToSegments($newsletterid = false, $timeToSend = false, $segmentids = array(), $saveSnapshots = true, $reloadFeed = true, $notifyOwner = false)
  • Added: notifyOwner

  • SendNewsletter

Previous:

public function SendNewsletter($newsletterid = 0, $subscriberid = 0, $email = '', $senderEmail = '', $senderName = '', $replyEmail = '', $callbackUrl = false, $reloadFeed = false)

Now:

public function SendNewsletter($newsletterid = 0, $subscriberid = 0, $email = '', $senderEmail = '', $senderName = '', $replyEmail = '', $callbackUrl = false, $reloadFeed = false, $notifyOwner = false)
  • Added: notifyOwner

New method:

  • UpdateOTMDocument
public function UpdateOTMDocument ($subscriberid = 0, $fieldid = 0, $fieldValueOTM = array(), $path = "")

  • RemoveOTMDocument
public function RemoveOTMDocument ($subscriberid = 0, $fieldid = 0, $path = "", $index = 0)

Differences between v1.2.13 and v1.2.14

Method definition changed:

  • ScheduleSendNewsletter

Previous:

public function ScheduleSendNewsletter($campaignid = false, $hours = false, $saveSnapshots = true)

Now:

public function ScheduleSendNewsletter($campaignid = false, $hours = false, $saveSnapshots = true, $reloadFeed = true)
  • Added: reloadFeed

  • ScheduleSendNewsletterToLists

Previous:

public function ScheduleSendNewsletterToLists($newsletterid = false, $timeToSend = false, $listids = array())

Now:

public function ScheduleSendNewsletterToLists($newsletterid = false, $timeToSend = false, $listids = array(), $saveSnapshots = true, $reloadFeed = true)
  • Added: saveSnapshots and reloadFeed

  • ScheduleSendNewsletterToSegments

Previous:

public function ScheduleSendNewsletterToSegments($newsletterid = false, $timeToSend = false, $segmentids = array())

Now:

public function ScheduleSendNewsletterToSegments($newsletterid = false, $timeToSend = false, $segmentids = array(), $saveSnapshots = true, $reloadFeed = true)
  • Added: saveSnapshots and reloadFeed

Differences between v1.2.12 and v1.2.13

New method:

  • CreateSegment
public function CreateSegment($name = "", $rules = array(), $connector = 'and')

Differences between v1.2.11 and v1.2.12

New method:

  • AddCustomFieldsToList
public function AddCustomFieldsToList($listid = false, $customFields = array())

Differences between v1.2.10 and v1.2.11

Method definition changed:

  • SendNewsletter

Previous:

public function SendNewsletter($newsletterid = 0, $subscriberid = 0, $email = '', $senderEmail = '', $senderName = '', $replyEmail = '')

Now:

public function SendNewsletter($newsletterid = 0, $subscriberid = 0, $email = '', $senderEmail = '', $senderName = '', $replyEmail = '', $callbackUrl = false, $reloadFeed = false)
  • Added: callbackUrl and reloadFeed

Differences between v1.2.9 and v1.2.10

New methods:

  • ScheduleSendNewsletterToLists

Definition:

public function ScheduleSendNewsletterToLists($newsletterid = false, $timeToSend = false, $listids = array())

  • ScheduleSendNewsletterToSegments

Definition:

public function ScheduleSendNewsletterToSegments($newsletterid = false, $timeToSend = false, $segmentids = array()))

Differences between v1.2.7 and v1.2.9

Method definition changed:

  • ScheduleSendNewsletter

Previous:

public function ScheduleSendNewsletter($campaignid = false, $hours = false)

Now:

public function ScheduleSendNewsletter($campaignid = false, $hours = false, $saveSnapshots = true)
  • Added: $saveSnapshots

New methods:

  • GetSentEmailCampaignEvents

Definition:

public function GetSentEmailCampaignEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetSentEmailCampaignWithTriggerEvents

Definition:

public function GetSentEmailCampaignWithTriggerEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetOpenCampaignEvents

Definition:

public function GetOpenCampaignEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetOpenTriggersEvents

Definition:

public function GetOpenTriggersEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetLinkClickCampaignEvents

Definition:

public function GetLinkClickCampaignEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetLinkClickTriggerEvents

Definition:

public function GetLinkClickTriggerEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetSentAutoresponderEvents

Definition:

public function GetSentAutoresponderEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetOpenAutoresponderEvents

Definition:

public function GetOpenAutoresponderEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetLinkClickAutoresponderEvents

Definition:

public function GetLinkClickAutoresponderEvents($from = false, $to = false $limit = 10, $offset = 0)

  • GetSentSMSCampaignEvents

Definition:

public function GetSentSMSCampaignEvents($from = false, $to = false $limit = 10, $offset = 0)


Differences between v1.2.6 and v1.2.7

New method:

  • GetTrackingEvents

Definition:

public function GetTrackingEvents($listid = false, $subscriberid = false, $limit = 100, $offset = 0)


Differences between v1.2.5 and v1.2.6

New methods:

  • GetLeadScore

Definition:

public function GetLeadScore($subscriberid = false)

  • SetLeadScore

Definition:

public function SetLeadScore($subscriberid = false, $leadScore = false, $type = "add")


Differences between v1.2.4 and v1.2.5

Method condition changed:

  • GetCustomFields

Previous:

public function GetCustomFields($listids = false) 

Now:

public function GetCustomFields($listids = false)
  • listids: is not required.


Differences between v1.2.3 and v1.2.4

New methods:

  • GetSnapshots

Definition:

public function GetSnapshots($subscriberid = false, $triggerid = false, $autoresponderid = false, $campaignid = false, $groupby = "date")

  • GetNewsletterSummary

Definition:

public function GetNewsletterSummary($newsletterid = false, $statid = false, $from = false, $to = false)

  • GetStatids

Definition:

public function GetStatids($listid = false, $segmentid = false, $newsletterid = false, $from = false, $to = false, $limit = 100, $offset = 0)


Differences between v1.2.2 and v1.2.3

Method definition changed:

  • ResubscribeContact

Previous:

public function ResubscribeContact($listid = false, $emailaddress = false, $mobileNumber = false, $mobilePrefix = false, $add_to_autoresponders = false)

Now:

public function ResubscribeContact($listid = false, $emailaddress = false, $mobileNumber = false, $mobilePrefix = false, $add_to_autoresponders = false, $contactFields = array())
  • Added: $contactFields.


Differences between v1.2.1 and v1.2.2

New methods:

  • GetTriggers

Definition:

public function GetTriggers($listid = false, $limit = 1000, $offset = 0)

  • GetSegments

Definition:

public function GetSegments($listid = false, $count_subscribers = false, $limit = 100, $offset = 0)


Differences between v1.1.11 and v1.2.1

New methods:

  • AddToOTMDocument

Definition:

public function AddToOTMDocument ($listid = false, $subscriberid = false, $emailaddress = false, $mobile = false, $mobilePrefix = false, $fieldid = false, $values = array(), $path = false)

  • GetSubscribersByCustomField

Definition:

public function GetSubscribersByCustomField ($listid = false, $data = array(), $activeonly = true, $countonly = false, $limit = 1000, $offset = 0)


Differences between v1.1.10 and v1.1.11

New methods:

  • GetTriggerSummary

Definition:

public function GetTriggerSummary($triggerid = false, $from = false, $to = false)

  • GetAutoresponderSummary

Definition:

public function GetAutoresponderSummary($autoresponderid = false, $from = false, $to = false)

Differences between v1.1.9 and v1.1.10

New methods:

  • GetSegmentSummary

Definition:

public function GetSegmentSummary($segmentid = false, $from = false, $to = false)

  • GetRulesForSegment

Definition:

public function GetRulesForSegment($segmentid = false)

  • EditNewsletter

Definition:

public function EditNewsletter($newsletterid = false, $name = false, $subject = false)

  • SetTriggerStatus

Definition:

public function SetTriggerStatus($triggerid = false, $status = false)

  • SetAutoresponderStatus

Definition:

public function SetAutoresponderStatus($autoresponderid = false, $status = false)


Differences between v1.1 and v1.1.9

New methods:

  • SendSMS

Definition:

public function SendSMS($campaignid = 0, $subject = '', $text = '', $subscriberid = 0, $listid = 0, $mobile = '', $mobilePrefix = '')

  • GetSubscribersFromSegment

Definition:

public function GetSubscribersFromSegment($segmentid = false, $countonly = false, $activeonly = true, $limit = 100, $offset = 0)

  • GetTriggersForSegment

Definition:

public function GetTriggersForSegment($segmentid)

  • ViewNewsletter

Definition:

public function ViewNewsletter($newsletterid)

Method definition changed:

  • GetNewsletters

Previous:

public function GetNewsletters($countOnly= false, $getLastSentDetails = false, $content = true, $aftercreatedate = false, $newsletterNameLike = false)

Now:

public function GetNewsletters($countOnly= false, $getLastSentDetails = false, $content = true, $aftercreatedate = false, $newsletterNameLike = false, $limit = false, $offset = false)
  • Added: $limit & $offset.


Differences between v1.0 and v1.1

Renamed methods:

Old name [v1.0] New name [v1.1]
Create_List CreateList
Update_List UpdateList
Delete_List DeleteList
Update_Subscriber UpdateSubscriber
Copy_Newsletter CopyNewsletter

Method definition changed:

  • UnsubscribeSubscriberEmail

Previous:

public function UnsubscribeSubscriberEmail ($emailaddress = false, $listid = false, $subscriberid = false, $skipcheck = false, $statid = false)

Now:

public function UnsubscribeSubscriberEmail ($listid = false, $emailaddress = false, $subscriberid = false, $skipcheck = false, $statid = false)

  • UnsubscribeSubscriberMobile

Previous:

public function UnsubscribeSubscriberMobile ($mobile = false, $mobilePrefix = false, $listid = false, $subscriberid = false, $skipcheck = false, $statid = false)

Now:

public function UnsubscribeSubscriberMobile ($listid = false, $mobile = false, $mobilePrefix = false, $subscriberid = false, $skipcheck = false, $statid = false)

  • GetSubscriberDetails

Previous:

public function GetSubscriberDetails($emailaddress = false, $listid = false)

Now:

public function GetSubscriberDetails($listid = false, $subscriberid = false, $emailaddress = false, $mobile = false, $mobile_prefix = false)
  • Added: subscriberid, mobile and mobile_prefix.

  • GetRecipients

Previous:

public function GetRecipients($statid = false, $stats_type = false, $count_only = false)

Now:

public function GetRecipients($statid = false, $count_only = false)
  • Removed: stats_type.

  • ActivateSubscriber

Previous:

public function ActivateSubscriber ($service = false, $lists = false, $emailaddress = false, $mobile = false, $mobile_prefix = false)

Now:

public function ActivateSubscriber ($service = false, $listid = false, $emailaddress = false, $mobile = false, $mobile_prefix = false, $subscriberid = false)
  • Added: subscriberid.

  • UpdateSubscriber

Previous:

public function UpdateSubscriber($subscriberid = false, $emailaddress = false, $mobile = false, $listid = false, $customfields = array())

Now:

public function UpdateSubscriber($listid = false, $subscriberid = false, $emailaddress = false, $mobile = false, $mobilePrefix = false, $customfields = array())
  • Added: mobile, mobilePrefix.

  • ScheduleSendSMS

Previous:

public function ScheduleSendSMS($campaignid = false, $hours = false, $lists = false)

Now:

public function ScheduleSendSMS($campaignid = false, $lists = false, $hours = false)

About

PHP class for using our company API as part of the subscription

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages