PHP Classes

File: getinboxes.php

Recommend this page to a friend!
  Packages of Andy Dixon   Textlocal   getinboxes.php   Download  
File: getinboxes.php
Role: Example script
Content type: text/plain
Description: Get Inboxes
Class: Textlocal
Send SMS or MMS messages using Textlocal API
Author: By
Last change:
Date: 13 years ago
Size: 667 bytes
 

 

Contents

Class file image Download
<?php
require('../textlocal.class.php');

$textlocal = new Textlocal('demo@txtlocal.com', 'apidemo123');

$groupId = 228839;
$startPos = 0;
$limit = 1000;

try {
    $result = $textlocal->getContacts($groupId, $limit, $startPos);

    /** Loop through contacts */
    foreach ($result->contacts as $contact) {
        $number = $contact->number;
        $firstName = $contact->first_name;
        $lastName = $contact->last_name;
        $custom1 = $contact->custom1;
        $custom2 = $contact->custom2;
        $custom3 = $contact->custom3;
    }

    print_r($result);
} catch (Exception $e) {
    die('Error: ' . $e->getMessage());
}
?>