Skip to content

smsplanetpl/smsplanet-java-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SMSPlanet JAVA API

JAR available here or in 'build' repository folder.

How to use

Sample code:

import pl.smsplanet.Request;
import pl.smsplanet.Response;

import java.io.IOException;

public class Main {

    public static void main(String[] args) { 
		
	final String key = "YourAPIKey";
        final String password = "YourApiPassword";
        final String from = "TEST";
        final String msg = "Sample text.";
        final String[] to = new String[] {"505111222"};

	SmsplanetRequest request = SmsplanetRequest.sendSMS(key, password, from, msg, to);
        try {
            SmsplanetResponse response = request.execute();
            if (response.getErrorCode() == 0) {
                System.out.println("Wiadomosc zostala wyslana. Nadany identyfikator: " + response.getMessageId());
            } else {
                System.err.println("Blad przetwarzania: " + response.getErrorMessage());
            }
        } catch (IOException e) {
            System.err.println("Nie udalo sie nawiazac polaczenia.");
        }

	}
}

About

SMSPLANET Java 8 library (maven)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages