BULK SMS AND VOICE BROADCAST API

Download as PDF

VOICE BROADCAST SMS API

Sample API Script (PHP)
<?php

//you can submit your voice broadcast thus:
// Specify your API account's 12-character key. 
$key='mykey';
// Specify your API account's 16-character secret. 
$secret= 'mysecret';
// Specify the relative path to your audio file. Only .mp3 files allowed. Max size: 3MB.
$audio_file= realpath('../audio/myMesage.mp3');// collect from form too
/* Specify the relative path to the file containing your contacts’ phone numbers . Only plain text (.txt) files allowed, one in single line
Max size: 3MB.
*/
$contacts_file= realpath('../contacts/bulkfile.txt');
// **************** HERE WE DO THE JOB**********************************
$data = array('key' => $key, 'secret' => $secret, 'audio_file'=>'@'.$audio_file, 'contacts_file' => '@'.$contacts_file);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://bulksms.ifihear.com/voice/remotesend/api.php');
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec ($ch);
curl_close ($ch);
// ************** END OF SECTION ******************************************************************
if (preg_match('/OK/i',$response))
{
// Broadcast request successfully submitted for delivery

}
else
{
// FAILED
echo $response;
// YOU CAN ADD YOUR CUSTOM CODE HERE
}
?>

IF YOU DONT UNDERSTAND ALL THESE ABOVE CALL US FOR HELP

 

 

 

BULK SMS APIs

1.0 INTRODUCTION

This document is meant to provide help and illustrations to users who wish to send SMS using Our SMS Gateway via HTTP Protocol and XML Protocol. Sending messages via the HTTP API is one of the best and the quickest ways to deliver SMS messages.

This document gives a detailed explanation of using the gateway through HTTP and XML API. All requests are to be made via http://sms.ifihear.com/API/WebSMS/Http/v3.1 (HTTP API) and http://sms.ifihear.com/API/WebSMS/XML/v1.3/index.php? (XML API) respectively

2.0HTTP API

2.1Send SMS HTTP API Request :

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?username=your+username&p

assword=Your+Password&sender=my+senderID&to=my+recipient&message=Hello+Test+M essage&reqid=1&format={json|text}&route_id=route+id&callback=Any+Callback+URL&unique=0&sendondate=05-06-2014T08:37:58

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway using HTTP API.

S/N

PARAMETER

 

DESCRIPTION

1

username

 

username

2

password

 

Password

 

3

sender

 

ID of the Sender

4

to

 

Number Send by the user

5

message

 

Content Send by the user

6

reqid

#

 

7 format Select either Json, text or tab  
8 route_id ID of the Route. Alpha Plus=2, Naija Plus=16  
9 callback #  
10 unique Use unique=1 then Remove Duplicate Entry  
11 sendondate Date && time of Sent Message  
12 msgtype Set msgtype=Unicode for Unicode Messages.  

Sending to Single Recipient

To send a message to a single recipient, you are to supply a mobile number to the “to” parameter, i.e. to=23470xxxxxxxx.

Example:

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?username=your+username&p

assword=Your+Password&sender=my+senderID&to=23471xxxxxxxx&message=Hello+Test+

Message&reqid=1&format=json

Sending to Multiple Recipients (Bulk Messaging)

To send a message to multiple recipients, you are to supply multiple mobile numbers separated with a coma (,), i.e. to=23470xxxxxxxx,23480xxxxxxxx,23471xxxxxxxx

Example:

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?username=your+username&p

assword=Your+Password&sender=my+senderID&to=23471xxxxxxxx,23480xxxxxxxx,23481xxxxxxxxxx&message=Hello+Test+Message&reqid=1&format=json

2.2. GROUP SMS HTTP API Request

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?username=peter&password=Your +Password&sender=my+senderID&group=groupid&message=Hello+Test+Message&reqid=1&for mat={json|text}&route_id=route+id&callback=Any+Callback+URL&unique=0&sendondate=05-06-2014T10:21:25

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Group HTTP API request.

through The if I HearSMS Bulk SMS Gateway For Group HTTP API request.

S/N

PARAMETER

 

DESCRIPTION

1

username

 

username

2

password

 

Password

 

3

sender

 

ID of the Sender

4

group

 

Group ID

5

message

 

Content Send by the user

6

reqid

#

 

7

format

 

Select either Json, text or tab

8

route_id

 

ID of the Route. Alpha Plus=2, Naija Plus=16

9

callback

#

 

10

unique

 

Use unique=1 then Remove Duplicate Entry

11

sendondate

 

Date && time of Sent Message

12

msgtype

 

Set msgtype=Unicode for Unicode Messages

 

2.3. Delivery Report HTTP API Request

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?method=show_dlr&username=pe ter&password=Your+Password&msg_id=message+id&seq_id=1,2&limit=0,10&format={json|tex t}

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Delivery Report HTTP API request.

S/N

PARAMETER

 

DESCRIPTION

1

username

 

username

2

password

 

Password

 

3

msg_id

 

Use message ID

4

seq_id

 

Use Seq ID like : (1,2)>

5

limit

 

Use limit like : (0,10)

6

format

 

Select either Json, text or tab

2.4. Check Credit HTTP API Request

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Check Credit HTTP API request.

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?method=credit_check&username =peter&password=Your+Password&format={json|text}

S/N

PARAMETER

 

DESCRIPTION

1

username

 

username

2

password

 

Password

 

3

format

 

Select either Json, text or tab

2.5. Route Inquire HTTP API Request

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Route Inquire API Request.

http://sms.ifihear.com/API/WebSMS/Http/v3.1/index.php?method=show_route&username= peter&password=Your+Password&format={json|text}

S/N

PARAMETER

 

DESCRIPTION

1

username

 

username

2

password

 

Password

 

3

format

 

Select either Json, text or tab


3.0.XML API

3.1.Send SMS XML API Request

http://sms.ifihear.com/API/WebSMS/XML/v1.3/index.php?xml=<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE MESSAGE SYSTEM

"http://127.0.0.1/psms/dtd/message.dtd" >

<MESSAGE>

<USER USERNAME="peter"

PASSWORD="<Password>" />

<SMS FORMAT="json" ROUTEID="<RouteID>" TEXT="<Message>" CALLBACK="<callback>" REQID="1" SENDER="<SenderID>" MSGTYPE="<text/unicode>" >

<ADDRESS

TO="<MOBILE NUMBER>" />

<ADDRESS

TO="<MOBILE NUMBER>" />

<ADDRESS

TO="<MOBILE NUMBER>" />

</SMS>

</MESSAGE>

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway using XML API.

S/N

PARAMETER

 

DESCRIPTION

1

USERNAME

 

username

2

PASSWORD

 

Password

 

3

FORMAT

 

Select either Json, text.

4

ROUTEID

 

ID of the Route. Alpha Plus=2, Naija Plus=16

5

TEXT

 

Content Send by the user

7

CALLBACK

#

 

8

REQID

#

 

9

SENDER

 

ID of the Sender

10

ADDRESS TO

 

Use Mobile number

11

MSGTYPE

 

Set msgtype=Unicode for Unicode Messages

 

 

3.2. GROUP SMS XML API Request

http://sms.ifihear.com/API/WebSMS/XML/v1.3/index.php?xml=<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE MESSAGE SYSTEM

"http://127.0.0.1/psms/dtd/message.dtd" >

<MESSAGE>

<USER USERNAME="peter"

PASSWORD="<Password>" />

<SMS FORMAT="json" ROUTEID="<RouteID>" TEXT="<Message>" CALLBACK="<callback>" REQID="1" SENDER="<SenderID>" MSGTYPE="<text/unicode>" >

<GROUP

ID="<group_id>" />

<GROUP

ID="<group_id>" />

</SMS>

</MESSAGE>

The following table gives the list of paramet

S/N

PARAMETER

 

DESCRIPTION

1

USERNAME

 

username

2

PASSWORD

 

Password

 

 

3

FORMAT

 

Select either Json, text.

4

ROUTEID

 

ID of the Route

5

TEXT

 

Content Send by the user

6

CALLBACK

 

#

 

 

7

REQID

 

#

 

 

8

SENDER

 

ID of the Sender

 

 

 

 

 

9

MSGTYPE

 

Use Message type Unicode

10

GROUP

 

Use Group ID

ers required for sending message through The if I HearSMS Bulk SMS Gateway For Group XML API request.

 

3.3. Delivery Report API Request

http://sms.ifihear.com/API/WebSMS/XML/v1.3/index.php?xml=<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE MESSAGE SYSTEM

"http://127.0.0.1/psms/dtd/message.dtd" >

<MESSAGE>

<USER USERNAME="peter"

PASSWORD="<Password>" />

<DLR

FORMAT="xml/json/text"

MSG_ID="<msg_id>"

SEQ_ID="<seq_id>" LIMIT="<limit>"

>

</DLR>

</MESSAGE>

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Delivery Report XML API request.

S/N

PARAMETER

 

DESCRIPTION

1

USERNAME

 

username

2

PASSWORD

 

Password

 

 

3

FORMAT

 

Select either Json, text.

4

MSG_ID

 

Use message ID

5

SEQ_ID

 

Use Seq ID like : (1,2)

6

LIMIT

 

Use limit like : (0,10)

 

 

 

 

 

 

 

 

3.4. Check Credit XML API Request

http://sms.ifihear.com/API/WebSMS/XML/v1.3/index.php?xml=<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE MESSAGE SYSTEM

"http://127.0.0.1/psms/dtd/message.dtd" >

<MESSAGE>

<USER USERNAME="peter"

PASSWORD="<Password>" />

<CREDITS

FORMAT="xml/json/text"

>

</CREDITS>

</MESSAGE>

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Check Credit XML API request.

S/N

PARAMETER

 

DESCRIPTION

1

USERNAME

 

username

2

PASSWORD

 

Password

 

3

FORMAT

 

Select either Json, text.

 

2.5. Route Inquire XML API Request

http://sms.ifihear.com/API/WebSMS/XML/v1.3/index.php?xml=<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE MESSAGE SYSTEM

"http://127.0.0.1/psms/dtd/message.dtd" >

<MESSAGE>

<USER USERNAME="peter"

PASSWORD="<Password>" />

<ROUTE

FORMAT="xml/json/text"

>

</ROUTE>

</MESSAGE>

The following table gives the list of parameters required for sending message through The if I HearSMS Bulk SMS Gateway For Route Inquire XML API Request.

S/N

PARAMETER

 

DESCRIPTION

1

USERNAME

 

username

2

PASSWORD

 

Password

 

3

FORMAT

 

Select either Json, text.