PHP code example of webtoolsnz / swift-sdk

1. Go to this page and download the library: Download webtoolsnz/swift-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/ */

    

webtoolsnz / swift-sdk example snippets


use \webtoolsnz\Swift\Swift;
use \webtoolsnz\Swift\Resources\Recipient;

$apiKey = 'INSERT_YOUR_API_KEY_HERE';
$endPoint = 'https://my.swift-app.com.au/api';

$swift = new Swift($endPoint, $apiKey);

$campaigns = $swift->getCampaigns();

var_dump($campaigns);

use \webtoolsnz\Swift\Swift;
use \webtoolsnz\Swift\Resources\Recipient;

$apiKey = 'INSERT_YOUR_API_KEY_HERE';
$endPoint = 'https://my.swift-app.com.au/api';

$swift = new Swift($endPoint, $apiKey);

$recipient = new Recipient();
$recipient->first_name = 'Philip';
$recipient->last_name = 'Fry';
$recipient->campaign_id = 123;
$recipient->mobile_number = "021234567";
$recipient->account_id = uniqid();

var_dump($swift->createRecipient($recipient));

use \webtoolsnz\Swift\Swift;
use \webtoolsnz\Swift\Resources\Recipient;

$apiKey = 'INSERT_YOUR_API_KEY_HERE';
$endPoint = 'https://my.swift-app.com.au/api';

$swift = new Swift($endPoint, $apiKey);

var_dump($swift->getRecipient(123));