Examples

Articles

Sending an SMS using the PHP/HTTP API
    <?php     /* Include PanaceaApi class */     require_once("panacea_api.php");     $api = new PanaceaApi ();     $api->setUsername("demouser");   ...
Generic HTTP Address book usage examples
--- HTTP Request trace for address_book_groups_get_list --- GET /json?action=address_book_groups_get_list&username=demouser&password=demouser HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Connection: keep-alive HTTP/1.1 ...
PHP API Address book usage examples
<?php /* Include PanaceaApi class */ require_once("sms_api.php"); $api = new PanaceaApi (); $api->setUsername("demouser"); $api->setPassword("demouser"); $groups = $api-> a...
PHP API Affiliate Program Example
<?php require_once('panacea_api.php'); /* * Panacea Affiliate program example * 1.) Get dialing code for an ip address * 2.) Create a new user * 3.) Set dialling code */ //setting user data $PanaceaApi = new Panac...
Generic HTTP API Affiliate Program Example
--- HTTP Request trace --- GET /json?action=affiliate_register_user&username=demouser&password=password&[email protected]&phone_number=0799999998&user_ip_address=61.88.1.255&dialling_code=27 HTTP/1.1 Ho...
HTTP Trace for checking a batch status
--- HTTP Request trace --- GET /json?action=batch_check_status&username=demouser&password=demouser&batch_id=39 HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Connection: keep-alive HTTP/1.1 200 OK Date: Sun, 02 Jan...
Perform batch functions using PHP API
<?php require_once("panacea_api.php"); $api = new PanaceaApi (); $api->setUsername("demouser"); $api->setPassword("demouser"); $file = "../generic/mybatch.csv"; $re...
Create a batch using a zip file using PHP
<?php require_once("panacea_api.php"); $api = new PanaceaApi (); $api->setUsername("demouser"); $api->setPassword("demouser"); $file = "../generic/mybatch.zip"; $r...
HTTP trace for creating a batch using a zip file
--- HTTP Request trace --- POST /json?action=batch_create&username=demouser&password=demouser&name=My+batch+name&file_type=zip&filter=false&throughput=0 HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Conn...
HTTP trace for starting a batch
GET /json?action=batch_start&username=demouser&password=demouser&batch_id=39 HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Connection: keep-alive HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 15:10:05 GMT Server:...
Perform execute_multiple using PHP API
<?php require_once("panacea_api.php"); /* This sample demonstrates how to send multiple actions to the API in a single request */ $api = new PanaceaApi (); $api->setUsername("demouser"); $ap...
JSON HTTP trace example
POST /json?action=execute_multiple&username=demouser&password=demouser HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Connection: keep-alive Content-Length: 485 Content-Type: application/x-www-form-urlencoded d...
Checking user balance using the Java API
package com.panaceamobile; import org.json.JSONObject; public class ApiExample { /** * @param args */ public static void main(String[] args) { Api api = new Api("demouser", "demouser"); api.setDebugging(fal...
Sending an SMS via JSON HTTP GET
GET /json?action=message_send&username=demouser&password=demouser&to=27111234567&text=Hello&from=27832659217 HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Connection: keep-alive HTTP/1.1 200 OK Date: ...
A generic HTTP request illustrating the use and response of route_check_price
--- HTTP Request trace --- GET /json?action=route_check_price&username=demo&password=demo&to=27111234567 HTTP/1.1 Host: smsapi.totalsend.com Accept: */* Connection: keep-alive HTTP/1.1 200 OK Date: Wed, 09 M...
A generic HTTP request illustrating the use and response of user_get_api_key()
--- HTTP Request trace --- GET /json?action=user_authorize_application&application_name=My+Application&return_url=http%3A%2F%2Fconsole.panaceamobile.com%2Fexamples%2Fdemos%2Fapi_key_creation%2Fstep2.php HTTP/1.1 Host: smsapi.tot...
A PHP based example on how to generate a usable API Key based on a successful authorization
<pre> <?php /* In this demonstration we will be demonstrating how to authorize your application to use a Panacea Mobile user's account */ require_once("../../php/panacea_api.php"); // Let's just includ...
A PHP based example on how to generate an API Key request token and redirect the user
<pre> <?php /* In this demonstration we will be demonstrating how to authorize your application to use a TotalSend user's account */ require_once("../../php/panacea_api.php"); // Let's just include the...