PHP-SDK

dokumentasjon og eksempler


Before you begin

Install latest version of the SDK with Composer: composer require "intellipush/intellipush-php-sdk-v2:dev-master"

Introduction to composer here.

Or download directly from GitHub.

Leave feedback, bugs, and feature requests on Github, or contact us on email: .


Setup automatic loading of the Intellipush library.

<?php 
        $applicationPath = __DIR__ . "/../YOUR APPLICATION PATH"; 
        require_once $applicationPath . "vendor/autoload.php"; 
         
        use Intellipush\Intellipush; 
         
        $key = "YOUR KEY"; 
        $secret = "YOUR SECRET"; 

        $intellipush = new Intellipush($key, $secret);
                        

Incoming URL

All incoming SMS that is forwarded to an URL from keyword settings page, is sent with the following POST parameters.

It is important to return a HTTP 200, else the URL will not be marked as delivered, and we will retry to trigger the URL again and again until we have tried 10 times, then it will be marked as permanently failed.

  • - request_sender is the phonenumber which the number is sent from.
  • - keyword is the main keyword.
  • - sub_keyword is the sub keyword if this is setup to be used.
  • - message is the actual message sent.

Get user account details

use Intellipush\User;

$user = new User();
$response = $intellipush->read($user);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"uid":"X","smscost":0.69,"dst":"1","timezonename":"Europe\/Berlin","register_time":"2015-01-01 12:00:00","smssendername":"Intellipush","senderemail":"jane.doe@email.com","senderemailname":"","smsprice":"","validatedphone":"1","name":"Jane Doe Inc"},"status_message":"Successfully got the user details."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [uid] => X
                    [smscost] => 0.69
                    [dst] => 1
                    [timezonename] => Europe/Berlin
                    [register_time] => 2015-01-01 12:00:00
                    [smssendername] => Intellipush
                    [senderemail] => jane.doe@email.com
                    [senderemailname] => 
                    [smsprice] => 
                    [validatedphone] => 1
                    [name] => Jane Doe Inc
                )

            [status_message] => Successfully got the user details.
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => Successfully got the user details.
)

Simplified functions

This is the most used functions in Intellipush in one line of code.
If you want more flexibility, and more functions scroll down to see how to fully use the SDK.


Simplified SMS

Sending an SMS with one line of code.

$response = Intellipush::auth($key, $secret)->sms("One liner magic with Intellipush!", "0047", $phonenumber);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"text_message":"One liner magic with Intellipush!","html_message":"","date":"2019-06-25","time":"06:22","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"12345678","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"X"},"status_message":"Your notification was successfully created."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [text_message] => One liner magic with Intellipush!
                    [html_message] => 
                    [date] => 2019-06-25
                    [time] => 06:22
                    [method] => sms
                    [repeat] => 
                    [single_target_countrycode] => 0047
                    [single_target] => 12345678
                    [contact_id] => 
                    [contactlist_id] => 
                    [contactlist_filter] => 
                    [use_sendername] => 1
                    [two_way_session] => 
                    [id] => X
                )

            [status_message] => Your notification was successfully created.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Your notification was successfully created.
)

Simplified contact

One line of code to create a contact.

$response = Intellipush::auth($key, $secret)->contact("John", "0047", "12345678", "name@email.com");

Or get a contact in one line.

$response = Intellipush::auth($key, $secret)->contact($id);

Simplified contactlist

One line of code to create a contactlist.

$response = Intellipush::auth($key, $secret)->contactlist("All clients");

Or get a contactlist in one line

$response = Intellipush::auth($key, $secret)->contactlist($id);

Send an SMS

Send an SMS with repeat, in the future, to a contact or contactlist.

use Intellipush\Notification\Sms;

$sms = new Sms();
$sms->receivers(
    array(
        array("0047",$phonenumber1),
        array("0047",$phonenumber2)
    )
)
->message("Intellipush is a great service!")
->when(new \DateTime("+20 minutes")); // has to be in the format 2013-04-20 22:15:00 or "now"

$response = $intellipush->create($sms);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => [{"success":true,"data":{"text_message":"Intellipush is a great service!","html_message":"","date":"2019-06-25","time":"06:42","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"$phonenumber1","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"X"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Intellipush is a great service!","html_message":"","date":"2019-06-25","time":"06:42","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"$phonenumber2","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"Y"},"status_message":"Your notification was successfully created."}]
    [response] => Array
        (
            [0] => stdClass Object
                (
                    [success] => 1
                    [data] => stdClass Object
                        (
                            [text_message] => Intellipush is a great service!
                            [html_message] => 
                            [date] => 2019-06-25
                            [time] => 06:42
                            [method] => sms
                            [repeat] => 
                            [single_target_countrycode] => 0047
                            [single_target] => $phonenumber1
                            [contact_id] => 
                            [contactlist_id] => 
                            [contactlist_filter] => 
                            [use_sendername] => 1
                            [two_way_session] => 
                            [id] => X
                        )

                    [status_message] => Your notification was successfully created.
                )

            [1] => stdClass Object
                (
                    [success] => 1
                    [data] => stdClass Object
                        (
                            [text_message] => Intellipush is a great service!
                            [html_message] => 
                            [date] => 2019-06-25
                            [time] => 06:42
                            [method] => sms
                            [repeat] => 
                            [single_target_countrycode] => 0047
                            [single_target] => $phonenumber2
                            [contact_id] => 
                            [contactlist_id] => 
                            [contactlist_filter] => 
                            [use_sendername] => 1
                            [two_way_session] => 
                            [id] => Y
                        )

                    [status_message] => Your notification was successfully created.
                )

        )

    [id] => 
    [errorId] => Array
        (
        )

    [success] => Array
        (
            [0] => X
            [1] => Y
        )

    [message] => Array
        (
            [0] => Your notification was successfully created.
            [1] => Your notification was successfully created.
        )

)

Send multiple SMS in batch

Here you can send up to 999 SMS per request. Faster for everyone.

use Intellipush\Notification\Batch;
use Intellipush\Notification\Sms;

$batch = new Batch();
$sms = new Sms();
$sms->receivers(
    array(
        array("0047",$phonenumber1),
        array("0047",$phonenumber2)
    )
)
->message("Intellipush is awesome!")
->when(new \DateTime("+20 minutes")); // Has to be in the format 2013-04-20 22:15:00

$batch->add($sms);

$sms = new Sms();
$sms->receivers(
    array(
        array("0047",$phonenumber3),
        array("0047",$phonenumber4)
    )
)
->repeat("daily") // can be daily, weekly or monthly
->message("Message to repeat daily. Intellipush Rocks!")
->when(new \DateTime("+20 minutes")); // Has to be in the format 2013-04-20 22:15:00

$batch->add($sms);

$response = $intellipush->create($batch);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => [{"success":true,"data":{"text_message":"Intellipush is awesome!","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"12345678","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"W"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Intellipush is awesome!","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"23456789","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"X"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Message to repeat daily. Intellipush Rocks!","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"daily","single_target_countrycode":"0047","single_target":"34567890","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"Y"},"status_message":"Your notification was successfully created."},{"success":true,"data":{"text_message":"Message to repeat daily. Intellipush Rocks!","html_message":"","date":"2015-01-29","time":"13:27","method":"sms","repeat":"daily","single_target_countrycode":"0047","single_target":"45678901","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":"Z"},"status_message":"Your notification was successfully created."}]
    [response] => Array
        (
            [0] => stdClass Object
                (
                    [success] => 1
                    [data] => stdClass Object
                        (
                            [text_message] => Intellipush is awesome!
                            [html_message] => 
                            [date] => 2015-01-29
                            [time] => 13:27
                            [method] => sms
                            [repeat] => 
                            [single_target_countrycode] => 0047
                            [single_target] => 12345678
                            [contact_id] => 
                            [contactlist_id] => 
                            [contactlist_filter] => 
                            [use_sendername] => 1
                            [two_way_session] => 
                            [id] => W
                        )

                    [status_message] => Your notification was successfully created.
                )

            [1] => stdClass Object
                (
                    [success] => 1
                    [data] => stdClass Object
                        (
                            [text_message] => Intellipush is awesome!
                            [html_message] => 
                            [date] => 2015-01-29
                            [time] => 13:27
                            [method] => sms
                            [repeat] => 
                            [single_target_countrycode] => 0047
                            [single_target] => 23456789
                            [contact_id] => 
                            [contactlist_id] => 
                            [contactlist_filter] => 
                            [use_sendername] => 1
                            [two_way_session] => 
                            [id] => X
                        )

                    [status_message] => Your notification was successfully created.
                )

            [2] => stdClass Object
                (
                    [success] => 1
                    [data] => stdClass Object
                        (
                            [text_message] => Message to repeat daily. Intellipush Rocks!
                            [html_message] => 
                            [date] => 2015-01-29
                            [time] => 13:27
                            [method] => sms
                            [repeat] => daily
                            [single_target_countrycode] => 0047
                            [single_target] => 34567890
                            [contact_id] => 
                            [contactlist_id] => 
                            [contactlist_filter] => 
                            [use_sendername] => 1
                            [two_way_session] => 
                            [id] => Y
                        )

                    [status_message] => Your notification was successfully created.
                )

            [3] => stdClass Object
                (
                    [success] => 1
                    [data] => stdClass Object
                        (
                            [text_message] => Message to repeat daily. Intellipush Rocks!
                            [html_message] => 
                            [date] => 2015-01-29
                            [time] => 13:27
                            [method] => sms
                            [repeat] => daily
                            [single_target_countrycode] => 0047
                            [single_target] => 45678901
                            [contact_id] => 
                            [contactlist_id] => 
                            [contactlist_filter] => 
                            [use_sendername] => 1
                            [two_way_session] => 
                            [id] => Z
                        )

                    [status_message] => Your notification was successfully created.
                )

        )

    [id] => 
    [errorId] => Array
        (
        )

    [success] => Array
        (
            [0] => 1
            [1] => 1
            [2] => 1
            [3] => 1
        )

    [message] => Array
        (
            [0] => Your notification was successfully created.
            [1] => Your notification was successfully created.
            [2] => Your notification was successfully created.
            [3] => Your notification was successfully created.
        )

)

List of parameters when sending a message

use Intellipush\Notification\Sms;

$sms = new Sms();

$sms->receivers(
    array(
        array("0047",$phonenumber)
    )
)
->message ("Intellipush is awesome!")
->contact (123) // Contact ID
->contactlist (123) // Contactlist ID
->contactlistFilter ( $contactfilter ) // This has to be a contactlistfilter object, see below.
->repeat ("daily") // Daily, weekly, monthly or blank.
->when ("now"); // Has to be in the format 2013-04-20 22:15:00, or "now"

Update scheduled SMS

use Intellipush\Notification\Sms;

$sms = new Sms();
$sms->id( $notification_id ) // Id on a scheduled message 
->message("Updated Intellipush rocks message!")
->repeat("") // removes repeat param if it was defined from before
->when(new \DateTime("+72 hours")); // Change sending time to 72 hours from now.

$response = $intellipush->update($sms);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"text_message":"Updated Intellipush rocks message!","html_message":"","date":"2019-06-28","time":"06:22","method":"sms","repeat":"","single_target_countrycode":"0047","single_target":"12345678","contact_id":"","contactlist_id":"","contactlist_filter":"","use_sendername":true,"two_way_session":"","id":X},"status_message":"Your notification was successfully updated."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [text_message] => Updated Intellipush rocks message!
                    [html_message] => 
                    [date] => 2019-06-28
                    [time] => 06:22
                    [method] => sms
                    [repeat] => 
                    [single_target_countrycode] => 0047
                    [single_target] => 12345678
                    [contact_id] => 
                    [contactlist_id] => 
                    [contactlist_filter] => 
                    [use_sendername] => 1
                    [two_way_session] => 
                    [id] => X
                )

            [status_message] => Your notification was successfully updated.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Your notification was successfully updated.
)

Delete message

You can delete messages that are not yet sent.

use Intellipush\Notification\Sms;

$sms = new Sms();
$sms->id( $id ); // ID of SMS you want to delete

$response = $intellipush->delete($sms);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X","when":"2019-06-28 06:22","text_message":"Intellipush is awesome.","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"},"status_message":"Your notification was successfully deleted."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                    [when] => 2019-06-28 06:22:00
                    [text_message] => Intellipush is awesome.
                    [method] => sms
                    [single_target_countrycode] => 0047
                    [single_target] => 12345678
                    [use_sendername] => 1
                )
            [status_message] => Your notification was successfully deleted.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Your notification was successfully deleted.
)

Get scheduled unsent messages

use Intellipush\Notification\Notifications;

$notifications = new Notifications();
$notifications->items(20)->page(1);
$response = $intellipush->read($notifications);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"X":{"id":"X","uid":"W","timetosend":"2015-01-25 19:56:02","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Intellipush is awesome!","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"},"Y":{"id":"Y","uid":"W","timetosend":"2015-01-25 19:56:16","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Intellipush really is awesome!","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"} },"status_message":"Successfully fetched notifications.","pages":292}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => X
                            [uid] => W
                            [timetosend] => 2050-01-01 20:00:00
                            [internal_id] => 
                            [external_id] => 
                            [deleted] => 0
                            [sendt] => 0
                            [text_message] => Intellipush is awesome!
                            [method] => sms
                            [single_target_countrycode] => 0047
                            [single_target] => 12345678
                            [use_sendername] => 1
                        )

                    [1] => stdClass Object
                        (
                            [id] => Y
                            [uid] => W
                            [timetosend] => 2050-01-01 20:00:00
                            [internal_id] => 
                            [external_id] => 
                            [deleted] => 0
                            [sendt] => 0
                            [text_message] => Intellipush really is awesome!
                            [method] => sms
                            [single_target_countrycode] => 0047
                            [single_target] => 12345678
                            [use_sendername] => 1
                        )

                )

            [status_message] => Successfully fetched notifications.
            [pages] => 1
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => Successfully fetched notifications.
)

Get sent messages

use Intellipush\Notification\Notifications;

$notifications = new Notifications();
$notifications->items(20)->page(1)->sent(true);

$response = $intellipush->read($notifications);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"X":{"id":"X","uid":"W","timetosend":"2015-01-25 19:56:02","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Intellipush is awesome!","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"},"Y":{"id":"Y","uid":"W","timetosend":"2015-01-25 19:56:16","internal_id":"","external_id":"","deleted":"0","sendt":"0","text_message":"Intellipush is awesome!","method":"sms","single_target_countrycode":"0047","single_target":"12345678","use_sendername":"1"} },"status_message":"Successfully fetched notifications.","pages":292}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => X
                            [uid] => W
                            [timetosend] => 2015-01-01 20:00:00
                            [internal_id] => 
                            [external_id] => 
                            [deleted] => 0
                            [sendt] => 0
                            [text_message] => Intellipush is awesome!
                            [method] => sms
                            [single_target_countrycode] => 0047
                            [single_target] => 12345678
                            [use_sendername] => 1
                        )

                    [1] => stdClass Object
                        (
                            [id] => Y
                            [uid] => W
                            [timetosend] => 2015-01-01 20:00:00
                            [internal_id] => 
                            [external_id] => 
                            [deleted] => 0
                            [sendt] => 0
                            [text_message] => Intellipush is awesome!
                            [method] => sms
                            [single_target_countrycode] => 0047
                            [single_target] => 12345678
                            [use_sendername] => 1
                        )

                )

            [status_message] => Successfully fetched notifications.
            [pages] => 1
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => Successfully fetched notifications.
)

Get received messages

Use keyword flag to get only messages received on a given keyword.

use Intellipush\Notification\Notifications;
$notifications = new Notifications();
$notifications->items(50)->page(1)->keyword("")->secondKeyword("")->received(true);
$response = $intellipush->read($notifications);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":[{"id":"X","uid":"Y","reference":"N","request_type":"sms","request_sender":"Z","request_target":"T","replypath":"0","trigger_external_path":"","keyword":"intellipush","second_keyword":"","message":"a","raw":"a:14:{s:1:\"q\";s:20:\"\/incoming\/vianettsms\";s:5:\"refno\";s:8:\"N\";s:3:\"now\";s:14:\"20150522030900\";s:11:\"requesttype\";s:2:\"mo\";s:10:\"sourceaddr\";s:10:\"Z\";s:15:\"destinationaddr\";s:4:\"T\";s:11:\"replypathid\";s:1:\"0\";s:6:\"prefix\";s:11:\"intellipush\";s:7:\"message\";s:1:\"a\";s:10:\"retrycount\";s:1:\"0\";s:8:\"operator\";s:1:\"1\";s:11:\"referenceid\";s:39:\"CPAd6569e1f-b119-4c86-88fb-816f5dd10ac8\";s:8:\"username\";s:0:\"\";s:8:\"password\";s:0:\"\";}","time":"2015-05-22 03:09:00"}],"status_message":"Successfully fetched received notifications.","pages":190}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => X
                            [uid] => Y
                            [reference] => N
                            [request_type] => sms
                            [request_sender] => Z
                            [request_target] => T
                            [replypath] => 0
                            [trigger_external_path] => 
                            [keyword] => intellipush
                            [second_keyword] => 
                            [message] => a
                            [raw] => a:14:{s:1:"q";s:20:"/incoming/vianettsms";s:5:"refno";s:8:"N";s:3:"now";s:14:"20150522030900";s:11:"requesttype";s:2:"mo";s:10:"sourceaddr";s:10:"Z";s:15:"destinationaddr";s:4:"T";s:11:"replypathid";s:1:"0";s:6:"prefix";s:11:"intellipush";s:7:"message";s:1:"a";s:10:"retrycount";s:1:"0";s:8:"operator";s:1:"1";s:11:"referenceid";s:39:"CPAd6569e1f-b119-4c86-88fb-816f5dd10ac8";s:8:"username";s:0:"";s:8:"password";s:0:"";}
                            [time] => 2015-05-22 03:09:00
                        )

                )

            [status_message] => Successfully fetched received notifications.
            [pages] => 1
        )

    [id] => Array
        (
            [0] => X
        )

    [errorId] => 
    [success] => 1
    [message] => Successfully fetched received notifications.
)

Get message status

use Intellipush\Notification\Status;

$status = new Status();
$status->id([$notification_id]);

$response = $intellipush->read($status);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"X":{"id":"X","sendt":"0","failed":0,"tries":0,"deleted":"0","timesendt":""} },"status_message":"Successfully got status on your notification."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [X] => stdClass Object
                        (
                            [id] => X
                            [sendt] => 0
                            [failed] => 0
                            [tries] => 0
                            [deleted] => 0
                            [timesendt] => 
                        )

                )

            [status_message] => Successfully got status on your notification.
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => Successfully got status on your notification.
)

Contact filter

When working with contacts and contactlists you can use filtering like this on several occations.

use Intellipush\Contact\Filter;

$contactfilter = new Filter();
$contactfilter->sex("female"); // Can be "male" or "female"
$contactfilter->age("20-30,41,42,43,50-60"); //Comma separated string
$contactfilter->country("norway, sweeden, denmark"); //Comma separated string
$contactfilter->company("Intellipush,Your company"); //Comma separated string
$contactfilter->param1("Value1, Value2"); //Comma separated string
$contactfilter->param2("Value1, Value2"); //Comma separated string
$contactfilter->param3("Value1, Value2"); //Comma separated string

Create contact

use Intellipush\Contact;
$contact = new Contact();

$contact->name("Jane Smith")
->countrycode($countrycode)
->phone($phonenumber)
->company("Intellipush")
->sex("female");

$response = $intellipush->create($contact);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"name":"Jane Smith","company":"Intellipush","dob":"","sex":"female","zipcode":"","country":"","countrycode":"0047","phonenumber":"12345678","email":"","facebook":"","twitter":"","param1":"","param2":"","param3":"","id":"X"},"status_message":"The contact was successfully created."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [name] => Jane Smith
                    [company] => Intellipush
                    [dob] => 
                    [sex] => female
                    [zipcode] => 
                    [country] => 
                    [countrycode] => 0047
                    [phonenumber] => 12345678
                    [email] => 
                    [facebook] => 
                    [twitter] => 
                    [param1] => 
                    [param2] => 
                    [param3] => 
                    [id] => X
                )

            [status_message] => The contact was successfully created.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => The contact was successfully created.
)

Get contact details

use Intellipush\Contact;

$contact = new Contact();
$contact->id($contact_id);

$response = $intellipush->read($contact);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"name":"Jane Smith","company":"Intellipush","dob":"","sex":"female","zipcode":"","country":"","countrycode":"0047","phonenumber":"12345678","email":"","facebook":"","twitter":"","param1":"","param2":"","param3":"","id":"X"},"status_message":"The contact was successfully created."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [name] => Jane Smith
                    [company] => Intellipush
                    [dob] => 
                    [sex] => female
                    [zipcode] => 
                    [country] => 
                    [countrycode] => 0047
                    [phonenumber] => 12345678
                    [email] => 
                    [facebook] => 
                    [twitter] => 
                    [param1] => 
                    [param2] => 
                    [param3] => 
                    [id] => X
                )

            [status_message] => The contact was successfully created.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => The contact was successfully created.
)

Update contact

use Intellipush\Contact;

$contact = new Contact();
$contact->id($id)->name("Updated Jane Smith");

$response = $intellipush->update($contact);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"name":"Updated Jane Smith","company":"Intellipush","dob":"","sex":"female","zipcode":"","country":"","countrycode":"0047","phonenumber":"12345678","email":"","facebook":"","twitter":"","param1":"","param2":"","param3":"","id":"X"},"status_message":"The contact was successfully updated."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [name] => Updated Jane Smith
                    [company] => Intellipush
                    [dob] => 
                    [sex] => female
                    [zipcode] => 
                    [country] => 
                    [countrycode] => 0047
                    [phonenumber] => 12345678
                    [email] => 
                    [facebook] => 
                    [twitter] => 
                    [param1] => 
                    [param2] => 
                    [param3] => 
                    [id] => X
                )

            [status_message] => The contact was successfully updated.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => The contact was successfully updated.
)

Delete contact

use Intellipush\Contact;

$contact = new Contact();
$contact->id($id);

$response = $intellipush->delete($contact);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X"},"status_message":"The contact was successfully deleted."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                )

            [status_message] => The contact was successfully deleted.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => The contact was successfully deleted.
)

    


Create contactlist

use Intellipush\Contactlist;

$contactlist = new Contactlist();
$contactlist->name("All clients");

$response = $intellipush->create($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"contactlist_name":"All clients","id":"X"},"status_message":"Your contactlist was successfully created."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [contactlist_name] => All clients
                    [id] => X
                )

            [status_message] => Your contactlist was successfully created.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Your contactlist was successfully created.
)

Get contactlist

This returns the contactlist along with all the ID of the contacts in the list

use Intellipush\Contactlist;

$contactlist = new Contactlist();
$contactlist->id($id);
$response = $intellipush->read($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X","list_name":"All clients","contacts":""},"status_message":""}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                    [list_name] => All clients
                    [contacts] => 
                )

            [status_message] => 
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => 
)

Update and rename a contactlist

use Intellipush\Contactlist;

$contactlist = new Contactlist();
$contactlist->id( $contactlist_id )->name("Updated all clients");

$response = $intellipush->update($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"contactlist_name":"Updated all clients","id":"X"},"status_message":"Your contactlist was successfully updated."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [contactlist_name] => Updated all clients
                    [id] => X
                )

            [status_message] => Your contactlist was successfully updated.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Your contactlist was successfully updated.
)

Delete contactlist

use Intellipush\Contactlist;

$contactlist = new Contactlist();
$contactlist->id( $id );

$response = $intellipush->delete($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X"},"status_message":"Contactlist successfully deleted."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                )

            [status_message] => Contactlist successfully deleted.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Contactlist successfully deleted.
)

Add contact to contactlist

use Intellipush\Contactlist;

$contactlist = new Contactlist();
$contactlist->id ( $contactlist_id )->contactId( $contact_id );

$response = $intellipush->create($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"contactlist_id":"X","contact_id":"Y"},"status_message":"The contact was added to the contactlist."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [contactlist_id] => X
                    [contact_id] => Y
                )

            [status_message] => The contact was added to the contactlist.
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => The contact was added to the contactlist.
)

Remove contact from contactlist

use Intellipush\Contactlist;

$contactlist = new Contactlist();
$contactlist->id ( $contactlist_id )->contactId( $contact_id );
$response = $intellipush->delete($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"contactlist_id":"X","contact_id":"Y"},"status_message":"The contact was removed from the contactlist."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [contactlist_id] => X
                    [contact_id] => Y
                )

            [status_message] => The contact was removed from the contactlist.
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => The contact was removed from the contactlist.
)

Get number of contacts in contactlist

use Intellipush\Notification\Sms;
use Intellipush\Contact\Filter;
$contactlist = new Sms();
$contactfilter = new Filter(); // Optional
$contactfilter->sex("female"); // Optional
$contactfilter->age("18,20,23,30-40,45"); // Optional
$contactlist->id ( $contactlist_id )->amount(true)->contactFilter($contactfilter);
$response = $intellipush->read($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"amount":"X"},"status_message":"Successfully got the number of contacts matching your filter."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [amount] => X
                )

            [status_message] => Successfully got the number of contacts matching your filter.
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => Successfully got the number of contacts matching your filter.
)

Get contacts in contactlists

Getting contacts in contactlist with an optional filter property

use Intellipush\Contactlist;
use Intellipush\Contact\Filter;

$contactlist = new Contactlist();
$contactfilter = new Filter();
$contactfilter->sex("female");
$contactlist->id( $contactlist_id )->items("20")->page("1")->query("")->contactFilter($contactfilter);

$response = $intellipush->read($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":"","status_message":"No contacts matching your search.","pages":0}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => 
            [status_message] => No contacts matching your search.
            [pages] => 0
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => No contacts matching your search.
)

Get contacts not in contactlists

use Intellipush\Contactlist;

$contactlist = new Intellipush\Contactlist();
$contactlist->id ( $contactlist_id )->items(20)->page(1)->query("")->notInContactlist(true);

$response = $intellipush->read($contactlist);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":"","status_message":"No contacts matching your search.","pages":0}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => 
            [status_message] => No contacts matching your search.
            [pages] => 0
        )

    [id] => 
    [errorId] => 
    [success] => 1
    [message] => No contacts matching your search.
)

Create short URL

You can create a short url, and later make child URLs for tracking individual contacts, with all stats collected on one parent URL.

use Intellipush\Url;

$url = new Url();
$url->longUrl("https://www.intellipush.com");

$response = $intellipush->create($url);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X","long_url":"https:\/\/www.intellipush.com","short_url":"http:\/\/1p.nu\/zZ","created":"2016-10-11 11:40:39"},"status_message":"Successfully created short url."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                    [long_url] => https://www.intellipush.com
                    [short_url] => http://1p.nu/zZ
                    [created] => 2016-10-11 11:40:39
                )

            [status_message] => Successfully created short url.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Successfully created short url.
)

Create child short URL

Create a child short url, this way you can have individual URLs for each contact, and later track if a certain contact has visited it. You can also filter on contact_id, phonenumber and email when listing all URLs.

use Intellipush\Url;


$url = new Url();
$url->parentUrlId("X"); // You must have first created a parent short url to be able to reference it.

$target = []; 
$target["contact_id"] = ""; // Optional
$target["email"] = "";  // Optional
$target["countrycode"] = "0047"; // Optional
$target["phonenumber"] = "xxxxxxxx"; // Optional

$url->target($target); // Optional, and only if you want to be able to track a users 

$response = $intellipush->create($url);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X","long_url":"https:\/\/www.intellipush.com","short_url":"http:\/\/1p.nu\/_2","created":"2016-10-11 11:44:23","target_countrycode":"0047","target_phonenumber":"xxxxxxxx","target_email":"","target_contact_id":""},"status_message":"Successfully created short child url."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                    [long_url] => https://www.intellipush.com
                    [short_url] => http://1p.nu/_2
                    [created] => 2016-10-11 11:44:23
                    [target_countrycode] => 0047
                    [target_phonenumber] => xxxxxxxx
                    [target_email] => 
                    [target_contact_id] => 
                )

            [status_message] => Successfully created short child url.
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => Successfully created short child url.
)

Get short URL details by ID or URL

Get details on a short URL. You can get the details either by ID or by the short URL itself.

use Intellipush\Url;

$url = new Url();

// USE THIS:
$url->id("X"); // Get details by ID 
// OR THIS:
$url->shortUrl("http://1p.nu/AAA"); // The short URL, works both with and without "http://1p.nu/"

$response = $intellipush->read($url);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":{"id":"X","long_url":"https:\/\/www.intellipush.com","short_url":"http:\/\/1p.nu\/gr","parent_url_id":"32","created":"2016-10-10 20:45:46","visited":"","visits":"","last_visited_time":"0000-00-00 00:00:00","target_countrycode":"","target_phonenumber":"","target_email":"","target_contact_id":""},"status_message":""}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => stdClass Object
                (
                    [id] => X
                    [long_url] => https://www.intellipush.com
                    [short_url] => http://1p.nu/AAA
                    [parent_url_id] => Y
                    [created] => 2016-10-10 20:45:46
                    [visited] => 1
                    [visits] => 52
                    [last_visited_time] => 0000-00-00 00:00:00
                    [target_countrycode] => 
                    [target_phonenumber] => 
                    [target_email] => 
                    [target_contact_id] => 
                )

            [status_message] => 
        )

    [id] => X
    [errorId] => 
    [success] => 1
    [message] => 
)

Get all short URLs

Get details on a short URL. You can get the details either by ID or by the short URL itself.

use Intellipush\Url;

$url = new Url();

$url->includeChildren(true); // Skip this if you only want to list parent URLs.

$url->parentUrlId(X); // Use this if you only want to get child URLs of one parent URL.

// Search through URLS and filter by target information; contact_id, email and countrycode + phonenumber.
$target = []; 
$target["contact_id"] = "X"; // Optional
$target["email"] = "xxxxxx@yyyyy.zzz";  // Optional
$target["countrycode"] = "0047"; // Optional
$target["phonenumber"] = "xxxxxxxx"; // Optional

$url->target($target);


$url->items(50);
$url->page(1);

$response = $intellipush->read($url);
Intellipush\Response Object
(
    [httpStatusCode] => 200
    [rawResponse] => {"success":true,"data":[{"id":"X","long_url":"","short_url":"http:\/\/1p.nu\/1-1","parent_url_id":"X","created":"2016-10-11 22:07:49","visited":"0","visits":"0","last_visited_time":"0000-00-00 00:00:00","target_countrycode":"0047","target_phonenumber":"xxxxxxxx","target_email":"","target_contact_id":"0"},{"id":"X","long_url":"","short_url":"http:\/\/1p.nu\/3q1","parent_url_id":"X","created":"2016-10-11 22:08:47","visited":"0","visits":"0","last_visited_time":"0000-00-00 00:00:00","target_countrycode":"0047","target_phonenumber":"xxxxxxxx","target_email":"","target_contact_id":"0"},{"id":"X","long_url":"","short_url":"http:\/\/1p.nu\/5v1","parent_url_id":"X","created":"2016-10-11 22:08:59","visited":"0","visits":"0","last_visited_time":"0000-00-00 00:00:00","target_countrycode":"0047","target_phonenumber":"xxxxxxxx","target_email":"","target_contact_id":"0"}],"status_message":"Successfully got URLs."}
    [response] => stdClass Object
        (
            [success] => 1
            [data] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => X
                            [long_url] => 
                            [short_url] => http://1p.nu/1-1
                            [parent_url_id] => X
                            [created] => 2016-10-11 22:07:49
                            [visited] => 0
                            [visits] => 0
                            [last_visited_time] => 0000-00-00 00:00:00
                            [target_countrycode] => 0047
                            [target_phonenumber] => xxxxxxxx
                            [target_email] => 
                            [target_contact_id] => 0
                        )

                    [1] => stdClass Object
                        (
                            [id] => X
                            [long_url] => 
                            [short_url] => http://1p.nu/3q1
                            [parent_url_id] => X
                            [created] => 2016-10-11 22:08:47
                            [visited] => 0
                            [visits] => 0
                            [last_visited_time] => 0000-00-00 00:00:00
                            [target_countrycode] => 0047
                            [target_phonenumber] => xxxxxxxx
                            [target_email] => 
                            [target_contact_id] => 0
                        )

                    [2] => stdClass Object
                        (
                            [id] => X
                            [long_url] => 
                            [short_url] => http://1p.nu/5v1
                            [parent_url_id] => X
                            [created] => 2016-10-11 22:08:59
                            [visited] => 0
                            [visits] => 0
                            [last_visited_time] => 0000-00-00 00:00:00
                            [target_countrycode] => 0047
                            [target_phonenumber] => xxxxxxxx
                            [target_email] => 
                            [target_contact_id] => 0
                        )


                )

            [status_message] => Successfully got URLs.
        )

    [id] => Array
        (
            [0] => X
            [1] => X
            [2] => X
        )

    [errorId] => 
    [success] => 1
    [message] => Successfully got URLs.

Any questions?

Please contact us, and we usually answer within a few hours.

E-mail:
Phone: +47 400 41 952

x
x
x
x