SMS
[ class tree: SMS ] [ index: SMS ] [ all elements ]

Class: SMS_Clickatell

Source Location: /Clickatell.php

Class Overview


PHP Interface into Clickatell API


Author(s):

Version:

  • $Id: Clickatell.php,v 1.23 2005/01/29 10:34:26 jacques Exp $

Copyright:

  • 2002-2005 Jacques Marneweck

Variables

Methods



Class Details

[line 31]
PHP Interface into Clickatell API



Tags:

access:  public
version:  $Id: Clickatell.php,v 1.23 2005/01/29 10:34:26 jacques Exp $
copyright:  2002-2005 Jacques Marneweck
author:  Jacques Marneweck <jacques@php.net>


[ Top ]


Class Variables

$_api_id =  null

[line 60]

Clickatell API Server ID


Type:   string


[ Top ]

$_api_server =  "https://api.clickatell.com"

[line 36]

Clickatell API Server


Type:   string


[ Top ]

$_errors = array (
      '001' => 'Authentication failed',
      '002' => 'Unknown username or password',
      '003' => 'Session ID expired',
      '004' => 'Account frozen',
      '005' => 'Missing session ID',
      '007' => 'IP lockdown violation',
      '101' => 'Invalid or missing parameters',
      '102' => 'Invalid UDH. (User Data Header)',
      '103' => 'Unknown apismgid (API Message ID)',
      '104' => 'Unknown climsgid (Client Message ID)',
      '105' => 'Invalid Destination Address',
      '106' => 'Invalid Source Address',
      '107' => 'Empty message',
      '108' => 'Invalid or missing api_id',
      '109' => 'Missing message ID',
      '110' => 'Error with email message',
      '111' => 'Invalid Protocol',
      '112' => 'Invalid msg_type',
      '113' => 'Max message parts exceeded',
      '114' => 'Cannot route message',
      '115' => 'Message Expired',
      '116' => 'Invalid Unicode Data',
      '201' => 'Invalid batch ID',
      '202' => 'No batch template',
      '301' => 'No credit left',
      '302' => 'Max allowed credit'
   )

[line 72]

Error codes generated by Clickatell Gateway


Type:   array


[ Top ]

$_fp =

[line 66]

Temporary file resource id


Type:   resource


[ Top ]

$_message_status = array (
      '001' => 'Message unknown',
      '002' => 'Message queued',
      '003' => 'Delivered',
      '004' => 'Received by recipient',
      '005' => 'Error with message',
      '006' => 'User cancelled message delivery',
      '007' => 'Error delivering message',
      '008' => 'OK',
      '009' => 'Routing error',
      '010' => 'Message expired',
      '011' => 'Message queued for later delivery',
      '012' => 'Out of credit'
   )

[line 106]

Message status


Type:   array


[ Top ]

$_msg_types = array (
      'SMS_TEXT',
      'SMS_FLASH',
      'SMS_NOKIA_OLOGO',
      'SMS_NOKIA_GLOGO',
      'SMS_NOKIA_PICTURE',
      'SMS_NOKIA_RINGTONE',
      'SMS_NOKIA_RTTL',
      'SMS_NOKIA_CLEAN',
      'SMS_NOKIA_VCARD',
      'SMS_NOKIA_VCAL'
   )

[line 121]


Type:   mixed


[ Top ]

$_password =  null

[line 54]

Password for Clickatell Usernaem


Type:   string


[ Top ]

$_session_id =  null

[line 42]

Clickatell API Server Session ID


Type:   string


[ Top ]

$_username =  null

[line 48]

Username from Clickatell used for authentication purposes


Type:   string


[ Top ]



Class Methods


method auth [line 141]

mixed auth( )

Authenticate to the Clickatell API Server.



Tags:

return:  true on sucess or PEAR_Error object
since:  1.1
access:  public


[ Top ]

method deletemsg [line 195]

void deletemsg( mixed $apimsgid)

Delete message queued by Clickatell which has not been passed onto the SMSC.



Tags:

see:  http://www.clickatell.com/downloads/Clickatell_http_2.2.2.pdf
since:  1.14
access:  public


[ Top ]

method getbalance [line 246]

void getbalance( )

Query balance of remaining SMS credits



Tags:

since:  1.9
access:  public


[ Top ]

method getmsgcharge [line 295]

void getmsgcharge( string $apimsgid)

Determine the cost of the message which was sent



Tags:

since:  1.20


Parameters:

string   $apimsgid   api_msg_id

[ Top ]

method init [line 369]

void init( [mixed $_params = array()])

Initilaise the Clicaktell SMS Class

  1. <?php
  2. require_once 'SMS/Clickatell.php';
  3.  
  4. $sms = new SMS_Clickatell;
  5. $res = $sms->init (
  6. array (
  7. 'user' => 'username',
  8. 'pass' => 'password',
  9. 'api_id' => '12345'
  10. )
  11. );
  12. if (PEAR::isError($res)) {
  13. die ($res->getMessage());
  14. }
  15. $res = $sms->auth();
  16. if (PEAR::isError($res)) {
  17. die ($res->getMessage());
  18. }
  19. ?>




Tags:

since:  1.9
access:  public


[ Top ]

method ping [line 398]

mixed ping( )

Keep our session to the Clickatell API Server valid.



Tags:

return:  true on sucess or PEAR_Error object
since:  1.1
access:  public


[ Top ]

method querymsg [line 451]

string querymsg( string $apimsgid)

Query message status



Tags:

return:  message status or PEAR_Error object
since:  1.5
access:  public


Parameters:

string   $apimsgid   spimsgid generated by Clickatell API

[ Top ]

method sendmsg [line 503]

mixed sendmsg( array $_msg)

Send an SMS Message via the Clickatell API Server



Tags:

return:  true on sucess or PEAR_Error object
since:  1.2
access:  public


Parameters:

array   $_msg   database result set

[ Top ]

method tokenpay [line 616]

void tokenpay( string $voucher)

Spend a clickatell voucher which can be used for topping up of sub user accounts.



Tags:

see:  http://www.clickatell.com/downloads/Clickatell_http_2.2.4.pdf
since:  1.22
access:  public


Parameters:

string   $voucher   voucher number

[ Top ]


Documentation generated on Sat, 29 Jan 2005 13:22:45 +0200 by phpDocumentor 1.3.0RC3