FOWiz provides an easy to use HTTP based API for sending SMS from your applications and browsers.

Setup

  1. Go to Settings and enter a passcode.
  2. Save the settings by clicking the Submit button.

Sending a test message from Browser

  1. Copy the HTTP API Url form Settings page and replace the passcode with yours.
  2. Replace username with your FOWiz username.
  3. Replace phonenumber with the number to which the message needs to be sent.
  4. Replace message with the message to be sent.
  5. Copy the modified url and paste it in your browser.

Sample HTTP API Url

http://cloud.fowiz.com/api/message_http_api.php?username=myusername&phonenumber=+19999999999&message=HelloWorld&passcode=MYPASSCODE

Note: Make sure you have installed FOWiz Android App on your phone and signed-in with your FOWiz username and password.

 

Sending message from PHP

<?php
    $mypasscode = 'your passcode';
    $my_username = 'your fowiz username';    
    $to_phone_number = 'recipient phone number';
    $my_message = 'your message';
    
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 
        "http://cloud.fowiz.com/api/message_http_api.php");
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
        'username' => $my_username,
        phonenumber' => $to_phone_number,
        'message' => $my_message,
        'passcode' => $my_passcode,
    ), '', '&'));        
    
    $result = curl_exec($curl);    
    $error = curl_error($curl);    
    curl_close($curl);    
    
    echo $result;
?>

Sending message from Java

        String myPasscode = 'your passcode';
        String myUsername = 'your fowiz username';    
        String toPhoneNumber = 'recipient phone number';
        String myMessage = 'your message';

        HttpClient client = new DefaultHttpClient();
        HttpGet request = new HttpGet("http://cloud.fowiz.com/api/message_http_api.php?username="+myUsername
                "&phonenumber="+toPhoneNumber+"&message="+myMessage+"&passcode="+myPasscode);
        HttpResponse response = client.execute(request);

        BufferedReader rd = new BufferedReader
          (new InputStreamReader(response.getEntity().getContent()));
    
        String line = "";
        StringBuffer response = new StringBuffer();
        while ((line = rd.readLine()) != null) {
                  response.append(line);
        }   
       
        System.out.println(response.toString());

Sending message from C#

        
        String myPasscode = 'your passcode';
        String myUsername = 'your fowiz username';    
        String toPhoneNumber = 'recipient phone number';
        String myMessage = 'your message';

        NameValueCollection postData = new NameValueCollection();
        postData["passcode"] = myPasscode;
        postData["username"] = myUsername;
        postData["phonenumber"] = toPhoneNumber;
        postData["message"] = myMessage;

        UTF8Encoding utf8 = new UTF8Encoding();
        byte[] postBytes = utf8.GetBytes(postData.ToString());            

        WebClient client = new WebClient();

        try
        {
            byte[] responseBytes = client.UploadValues("http://cloud.fowiz.com/api/message_http_api.php", postData);
            String response = utf8.GetString(responseBytes);
            Console.WriteLine(response);
        }
        catch (WebException ex)
        {
            Console.WriteLine(ex.ToString());
        }