PHP code example of agyson / interakt-php-sdk

1. Go to this page and download the library: Download agyson/interakt-php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

agyson / interakt-php-sdk example snippets




use Agyson\InteraktPhpSdk\Interakt;

$sms = new Interakt(env('api_key'));

// Get All Users
$interakt->get_users(
      $offset = 0,
      $limit = 100,
      $filter_start_date = "2010-01-01",
      $filter_end_date = "2023-01-01"
);

// Creating & Updating Users
$interakt->track_user(
      $userId = null,
      $fullPhoneNumber = null,
      $phoneNumber = null,
      $countryCode = null,
      $traits = [],
      $tags = []
);

// Assign Events to Specific Users
$interakt->track_event(
     $userId = null,
     $fullPhoneNumber = null,
     $phoneNumber = null,
     $countryCode = null,
     $event = null,
     $traits = []
);

// Send Message Templates
$interakt->send_template(
    $fullPhoneNumber = null,
    $phoneNumber = null, 
    $countryCode = null,
    $callbackData = null,
    $templateName = null,
    $templateLanguageCode = null
    $headerValues = [],
    $bodyValues = [],
    $buttonValues = [],
);

bash
composer