Panacea Mobile Bulk SMS Gateway

we are hiring! EnglishFrenchGermanItalianPortugueseRussianSpanish

SA: +27-87-151-1043 UK: +44-2030-269-458 IRE: +353-15-547-236

  • Home
  • SMS Gateway
    • Pricing & Coverage
    • Inbound Messaging
    • Premium Rate
    • Online Console
    • Compare us
  • Bulk SMS
    • Your Industry
      • Retail
      • Corporate
      • Health
      • Service
      • Entertainment
  • Developers
    • Available API’s
      • HTTP API
      • SMPP API
      • SMTP/MAIL API
    • Authentication with our API
    • Receiving requests from us
      • Inbound (reply/MO) messages
      • Delivery reports
    • Sample Code
      • Python
      • PHP
      • Java
      • C Sharp (C#)
  • Number Validation
  • Virtual SMSC
    • Administrative Features
    • User Features
    • Core System
    • Screenshots
    • FAQ
    • vSMSC Agreement
    • Order
    • Updates
  • Clients
  • About
    • Careers
      • Mobile Campaign Manager
    • Anti-Spam
  • Support
    • FAQ
    • Kannel SLA Support
      • SLA Agreement
  • Blog
  • Contact
    • Home
    • SMS Gateway
      • Pricing & Coverage
      • Inbound Messaging
      • Premium Rate
      • Online Console
      • Compare us
    • Bulk SMS
      • Your Industry
        • Retail
        • Corporate
        • Health
        • Service
        • Entertainment
    • Developers
      • Available API’s
        • HTTP API
        • SMPP API
        • SMTP/MAIL API
      • Authentication with our API
      • Receiving requests from us
        • Inbound (reply/MO) messages
        • Delivery reports
      • Sample Code
        • Python
        • PHP
        • Java
        • C Sharp (C#)
    • Number Validation
    • Virtual SMSC
      • Administrative Features
      • User Features
      • Core System
      • Screenshots
      • FAQ
      • vSMSC Agreement
      • Order
      • Updates
    • Clients
    • About
      • Careers
        • Mobile Campaign Manager
      • Anti-Spam
    • Support
      • FAQ
      • Kannel SLA Support
        • SLA Agreement
    • Blog
    • Contact
  • Java

    In order to make it easy for Java developers we have developed a class which we have made available to you.

    You can download the a .jar file here, or alternatively you can download the full source of the Java here.

    The JavaDoc for this class is available here.

    Once you have add this library or code to your project, you may use the class as you can see below:

    import org.json.JSONObject;
    
    public class ApiExample {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    
    		Api api = new Api("demouser", "demouser");
    		api.setDebugging(false);
    
    		String message_id = api.message_send("27111234567", "Hi there, I just sent a message!", "0214224825", null, null, null, null); /* Not all arguments are required */
    		if(message_id != null) {
    			System.out.println("It worked! Your message was sent!");
    
    			/* Now we can do some other checks */
    
    			Double balance = api.user_get_balance();
    			if(balance != null) {
    				System.out.println("Great! My balance is "+balance.toString());
    			}
    
    			JSONObject status = api.message_status(message_id);
    			if(status != null) {
    				try {
    					System.out.println("Message cost was "+String.valueOf(status.getDouble("cost")));
    					System.out.println("Message status is now "+String.valueOf(status.getInt("status")));
    					System.out.println("Message had "+String.valueOf(status.getInt("parts")) + " parts");
    
    				} catch(Exception e) {
    					System.out.println("JSON Error");
    					e.printStackTrace();
    				}
    			}
    		} else {
    			System.out.println("Could not send message :( ");
    		}
    
    	}
    
    }
    

    This class is based on the HTTP API.

    See HTTP API Documentation

  • Services

      • Sms Gateway
      • Bulk SMS
      • Strategy Consulting
      • Premium Rate
      • Number Validation
      • Mobile Media Planning
      • Campaign Management
      • Inbound Messaging
      • Mobile Application Development
      • SMS Development & Support
      • Online Console

    Pricing

      • Bulk SMS
      • Inbound Messaging
      • Premium Rate
  • About Us

      • About
      • Anti-Spam
      • Team
      • Careers
      • Why Us?

    Support

      • Available API’s
      • Sample Code
      • FAQ
  • Contact Us

      • Sales
      • Support

    Legal

      • Terms & Conditions

    Join us on Facebook

  • API connectivity

    Visa Master Card PayPal

    All rights reserved Panacea Mobile