Kerry Buckley

What’s the simplest thing that could possibly go wrong?

BT’s Java SDK

4 comments

As I mentioned recently, I now work in the Web21C SDK team. The SDK provides a simple API for programmatically accessing various web services that BT provides, including SMS, conference calls and location services.

The SDK is in public beta, and is currently free (with daily usage limits). Up to now it’s only been available for those crazy .NET folks, but the next release (on Monday, all being well) will extend that to Java, PHP and Python. Rumour has it that Ruby’s in the works too.

I’ve been having a play with the Java version – here’s a sneak preview…

There are a few steps to get set up. First you need to create an account on the website. You then need to download and run a Java application to register your application and create a certificate to identify you to the underlying services. Then there are a few JARs to put in your classpath, a properties file to update with your username, password and certificate filename, and you’re ready to go.

For example, this is all you need to write to send a text message:

package com.kerrybuckley.sdkdemo;

import com.bt.sdk.sms.Messaging;
import com.bt.sdk.sms.SmsMessage;

public class SmsDemo {
    public static void main(String[] args) {
        Messaging smsService = new Messaging();
        SmsMessage message = new SmsMessage();
        message.addRecipient("tel:+447700900123");
        message.setSubject("Testing...");
        message.setMessageText("Hello world, from the Web21C SDK");
        smsService.send(message);
    }
}

Pretty self-explanatory, and just to prove it works:

SMS Message

Technorati Tags: , ,

Written by Kerry

February 17th, 2007 at 5:01 pm

Posted in BT,Java,Web21C

4 Responses to 'BT’s Java SDK'

Subscribe to comments with RSS or TrackBack to 'BT’s Java SDK'.

  1. I hope smsService.send() has overloads!

    DE

    19 Feb 07 at 12:44 am

  2. Yes, Messaging#send() is overloaded.

    What DE is getting at is that instead of this:

    Messaging smsService = new Messaging();
    SmsMessage message = new SmsMessage();
    message.addRecipient("tel:+447700900123");
    message.setSubject("Testing...");
    message.setMessageText("Hello world, from the Web21C SDK");
    smsService.send(message);
    

    I could have just used a convenience method:

    Messaging smsService = new Messaging();
    smsService.send("tel:+447700900123",
            "Hello world, from the Web21C SDK",
            "Testing...");
    

    Kerry

    19 Feb 07 at 12:42 pm

  3. Holy Crap!! BT announce Web API…

    British Telecom have announced an API, called Web21C (catchy!) that grants you access to some of their network services, SMS, VOICE CALLS!! and, well pretty much every service BT offer. If they don’t get it all tangled in the usual BT beurocracy,…

    Stubblog

    9 Mar 07 at 12:31 am

  4. BT are always proposing excellent services, if these ever actualy get realised they usually fail to live up to their potential

    Zac

    8 Dec 08 at 1:25 pm

Leave a Reply

You must be logged in to post a comment.