« Back

WebEx API's and Cius, Part I

In this first post in a new series detailing the functionalities of WebEx and its API's in relation to the Cius, I will discuss the process of joining a WebEx meeting by meeting ID, either as the host or as a general attendee, on the Cius. For the sake of this post, I will be using the WebEx URL API. Although this same task can be accomplished using WebEx's XML API, I decided that it would be best to focus on one, "best case" way for accomplishing this task.

To start the task at hand, a person would need to have at least two things, a meeting key (meeting ID) and your WebEx hosted name. These should be collected from the user, or could be farmed out of a user's emails or calendar events, depending on what kind of application you are writing and the permissions given to you. With these two bits of information, you will now need to create a well-formed URL that will allow the user to join the meeting. This URL will look something like this:

1https://myHostedName.webex.com/myHostedName/m.php?AT=JM&MK=myMeetingKey


Where the only changes you would need to make would be to substitute your meeting key for <myMeetingKey> and substitute the WebEx hosted name for <myHostedName>. Optionally, if there is a password for the meeting, the URL would look the same as above, however with an extra field for the password being added. This is shown below. In your implementation, the meeting password would be inserted for <myPassword>:

1.../m.php?AT=JM&MK=myMeetingKey&PW=myPassword


This is all fine and good, but what if you are the host of the meeting? In this case, you would need would need to sign in to become the host and start the meeting. There are many ways to do this for different situations, but in this case, you need to log the user in, and do so in such a way that the Cius' built in WebEx client knows you are logged in. To do this, you would need to send the following Uri in an intent as shown:

1Intent i=new Intent();
2i.setData(Uri.parse("wbx://WbxSignIn"));
3startActivityForResult(i, myRequestCode);


where <myRequestCode> is a code specific to your application that you come up with so that when your application gets a result back, you know that it was for you. For more information on this, see the Activity documentation for Android. This will launch an intent to the WebEx client that will allow the user to sign in if not signed in already. If the user successfully signs in, a result of value -1 (RESULT_OK) will be returned. If the user does not login for some reason, a result of 0 (RESULT_CANCELED) will be returned. Your complete code for a meeting with a password should look something like this:

 
 1private void joinWebExmeeting(Boolean isHost) {
 2
 3 Intent i=new Intent();
 4 if(isHost)
 5 {
 6     i.setData(Uri.parse("wbx://WbxSignIn"));
 7     startActivityForResult(i, myRequestCode);
 8 }
 9 else
10{
11    i.setData(Uri.parse("https://"+myHostedName+".webex.com/"+
12        myHostedName+"/m.php?AT=JM&MK="+myMeetingKey+"&PW="+myPassword));
13    startActivity(i);
14}
15
16@Override
17protected void onActivityResult(int requestCode, int resultCode, Intent data) {
18if(requestCode==yourRequestCode) {
19    if(resultCode==RESULT_OK)
20    {
21        Intent i=new Intent();
22        i.setData(Uri.parse("https://"+myHostedName+".webex.com/"+
23            myHostedName+"/m.php?AT=HM&MK="+myMeetingKey+"&PW="+myPassword));
24        startActivity(i);
25    }
26    if(resultCode==RESULT_CANCELED)
27    {
28        //do something to make user retry since login failed
29    }
30} else {
31//do something if not your Request Code
32}
33}


This code would now just need to be implemented in your Android application to successfully launch and attend a meeting, either as an attendee or host. For further information about the syntax of the URL's shown in this example, the documentation for the URL API's can be found here.

Also, a testing (sandbox) environment for creating and joining meetings in WebEx is provided for devlopers and can be found here.
Comments