2017 © Pedro Peláez
 

library api_parser

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

image

emailplatform/api_parser

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

  • Wednesday, July 4, 2018
  • by emailplatform
  • Repository
  • 0 Watchers
  • 0 Stars
  • 324 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 511 % Grown

The README.md

ApiParser

PHP class for using our company's API as part of the subscription., (*1)



, (*2)

Installation

Run following command in terminal from the root of your project:, (*3)

composer require emailplatform/api_parser

You can load dependencies by adding these lines to your code:, (*4)

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


, (*5)

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);


, (*6)

Changelog:

Differences between v1.2.21 and v1.2.22

Method definition changed:

  • ChangeMobile > Now: > php > $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:, (*7)

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:, (*8)

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., (*9)

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:, (*10)

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

    Previous:, (*12)

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

    Now:, (*13)

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

    Previous:, (*15)

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

    Now:, (*16)

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

    Previous:, (*18)

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

    Now:, (*19)

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

New method:

  • UpdateOTMDocument, (*20)

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


    , (*21)

  • RemoveOTMDocument, (*22)

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


    , (*23)

Differences between v1.2.13 and v1.2.14

Method definition changed:

  • ScheduleSendNewsletter, (*24)

    Previous:, (*25)

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

    Now:, (*26)

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

    Previous:, (*28)

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

    Now:, (*29)

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

    Previous:, (*31)

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

    Now:, (*32)

    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 > php > public function CreateSegment($name = "", $rules = array(), $connector = 'and') >

Differences between v1.2.11 and v1.2.12

New method:

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

Differences between v1.2.10 and v1.2.11

Method definition changed:

  • SendNewsletter > Previous: > php > public function SendNewsletter($newsletterid = 0, $subscriberid = 0, $email = '', $senderEmail = '', $senderName = '', $replyEmail = '') > > Now: > php >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, (*33)

    Definition:, (*34)

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


    , (*35)

  • ScheduleSendNewsletterToSegments, (*36)

    Definition:, (*37)

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


    , (*38)

Differences between v1.2.7 and v1.2.9

Method definition changed:

  • ScheduleSendNewsletter > Previous: > php > public function ScheduleSendNewsletter($campaignid = false, $hours = false) > > Now: > php > public function ScheduleSendNewsletter($campaignid = false, $hours = false, $saveSnapshots = true) > > * Added: $saveSnapshots

New methods:

  • GetSentEmailCampaignEvents, (*39)

    Definition:, (*40)

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


    , (*41)

  • GetSentEmailCampaignWithTriggerEvents, (*42)

    Definition:, (*43)

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


    , (*44)

  • GetOpenCampaignEvents, (*45)

    Definition:, (*46)

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


    , (*47)

  • GetOpenTriggersEvents, (*48)

    Definition:, (*49)

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


    , (*50)

  • GetLinkClickCampaignEvents, (*51)

    Definition:, (*52)

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


    , (*53)

  • GetLinkClickTriggerEvents, (*54)

    Definition:, (*55)

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


    , (*56)

  • GetSentAutoresponderEvents, (*57)

    Definition:, (*58)

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


    , (*59)

  • GetOpenAutoresponderEvents, (*60)

    Definition:, (*61)

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


    , (*62)

  • GetLinkClickAutoresponderEvents, (*63)

    Definition:, (*64)

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


    , (*65)

  • GetSentSMSCampaignEvents, (*66)

    Definition:, (*67)

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


, (*68)

Differences between v1.2.6 and v1.2.7

New method:

  • GetTrackingEvents > Definition: > php > public function GetTrackingEvents($listid = false, $subscriberid = false, $limit = 100, $offset = 0) >


, (*69)

Differences between v1.2.5 and v1.2.6

New methods:

  • GetLeadScore, (*70)

    Definition:, (*71)

    public function GetLeadScore($subscriberid = false)
      


    , (*72)

  • SetLeadScore, (*73)

    Definition:, (*74)

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


, (*75)

Differences between v1.2.4 and v1.2.5

Method condition changed:

  • GetCustomFields > Previous: > php > public function GetCustomFields($listids = false) > > Now: > php > public function GetCustomFields($listids = false) > > * listids: is not required.


, (*76)

Differences between v1.2.3 and v1.2.4

New methods:

  • GetSnapshots, (*77)

    Definition:, (*78)

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


    , (*79)

  • GetNewsletterSummary, (*80)

    Definition:, (*81)

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


    , (*82)

  • GetStatids, (*83)

    Definition:, (*84)

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


, (*85)

Differences between v1.2.2 and v1.2.3

Method definition changed:

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


, (*86)

Differences between v1.2.1 and v1.2.2

New methods:

  • GetTriggers, (*87)

    Definition:, (*88)

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

    br/, (*89)

  • GetSegments, (*90)

    Definition:, (*91)

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


, (*92)

Differences between v1.1.11 and v1.2.1

New methods:

  • AddToOTMDocument, (*93)

    Definition:, (*94)

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


    , (*95)

  • GetSubscribersByCustomField, (*96)

    Definition:, (*97)

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


, (*98)

Differences between v1.1.10 and v1.1.11

New methods:

  • GetTriggerSummary, (*99)

    Definition:, (*100)

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

    br/, (*101)

  • GetAutoresponderSummary, (*102)

    Definition:, (*103)

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


    , (*104)

Differences between v1.1.9 and v1.1.10

New methods:

  • GetSegmentSummary, (*105)

    Definition:, (*106)

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


    , (*107)

  • GetRulesForSegment, (*108)

    Definition:, (*109)

    public function GetRulesForSegment($segmentid = false)
      
      


    , (*110)

  • EditNewsletter, (*111)

    Definition:, (*112)

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


    , (*113)

  • SetTriggerStatus, (*114)

    Definition:, (*115)

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


    , (*116)

  • SetAutoresponderStatus, (*117)

    Definition:, (*118)

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


, (*119)

Differences between v1.1 and v1.1.9

New methods:

  • SendSMS, (*120)

    Definition:, (*121)

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


    , (*122)

  • GetSubscribersFromSegment, (*123)

    Definition:, (*124)

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


    , (*125)

  • GetTriggersForSegment, (*126)

    Definition:, (*127)

    public function GetTriggersForSegment($segmentid)
      
      


    , (*128)

  • ViewNewsletter, (*129)

    Definition:, (*130)

    public function ViewNewsletter($newsletterid)
      
      


    , (*131)

Method definition changed:

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


, (*132)

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


, (*133)

Method definition changed:

  • UnsubscribeSubscriberEmail, (*134)

    Previous:, (*135)

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

    Now:, (*136)

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


    , (*137)

  • UnsubscribeSubscriberMobile, (*138)

    Previous:, (*139)

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

    Now:, (*140)

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


    , (*141)

  • GetSubscriberDetails, (*142)

    Previous:, (*143)

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

    Now:, (*144)

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

    Previous:, (*146)

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

    Now:, (*147)

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

    Previous:, (*149)

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

    Now:, (*150)

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

    Previous:, (*152)

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

    Now:, (*153)

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

    Previous:, (*155)

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

    Now:, (*156)

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

The Versions

04/07 2018

dev-master

9999999-dev https://github.com/emailplatform/ApiParser

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

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

api library

04/07 2018

1.1

1.1.0.0 https://github.com/emailplatform/ApiParser

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

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

api library

27/12 2017

dev-version1.1

dev-version1.1 https://github.com/emailplatform/ApiParser

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

  Sources   Download

MIT

The Requires

 

api library

22/12 2017

dev-version1.0

dev-version1.0 https://github.com/emailplatform/ApiParser_v_1.0

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

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

api library

22/12 2017

1.0

1.0.0.0 https://github.com/emailplatform/ApiParser_v_1.0

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

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

api library