API Reference

This module handles the SDK initialization and registration. This module has the following classes:

IMI.IMIconnect

This class contains the methods to initialize the SDK and register a user. When integrating the SDK into your app it is mandatory to use this class to initialize the SDK before any other features are used. With the exception of the Authentication module, it is also necessary to register a user before other features are used.

Public Methods
startup()
shutdown()
register(deviceProfile, regcallback)
unregister()
boolean isRegistered()
updateProfileData()
boolean removeProfileData()
setSecurityToken
registerListener
unregisterListener

startup

This method is used to initialize the SDK with configuration as per ‘default’ configuration in the imi-environments.js file.

Syntax: startup()

IMI.IMIconnect.startup();

shutdown

This method is used to clean up the SDK, freeing all internal object instances. Invoking this method will stop the SDK features from functioning and as such RTM will no longer be received.

Syntax: shutdown()

// Provides a means to shutdown the SDK and perform cleanup, after this method is called none of the SDK features will work
try {
    IMI.IMIconnect.shutdown();
} catch (error) {
    console.log(error)
}

register

This method is used to register the userId with Webex Connect. This method reads the device details and sends to the Webex Connect platform. Once a user is registered all further SDK calls take place in the context of that user.

Syntax: register(deviceProfile, regcallback)

Parameters:

ParameterTypeDescription
deviceProfile[ICDeviceProfile]Specifies the device profile registered with Webex Connect.
regcallbackObjectRefer to example below.
//Verify whether the user is registered or not, if not registered, register the user.
if (!IMI.IMIconnect.isRegistered()) {
    var callback = {
        onSuccess: function(data) {
            console.log("reg success",datauserId);
              
            //Write you code to connect to <<prodname>>. 
        },
        onFailure: function(errormsg) {
            console.log("reg failed");
        }

    };
  var deviceProfile=new IMI.ICDeviceProfile(deviceId, userId);  
           //here user id is  optional (If user id not there user can call deviceID,  
             userId will be generated by <<prodname>> and passed to callback function)
          //var  deviceProfile = new IMI.ICDeviceProfile(deviceId);
          IMI.IMIconnect.register(deviceProfile, callback);
  }
else{
//Write you code to connect to <<prodname>>. 
}

unregister

This method is used to unregister the current user. The features that rely on a registered user will no longer function after this method has been called.

Syntax: IMI.IMIconnect.unregister(unregisterCallback);

ParameterType
unregisterCallbackCallback
var unregisterCallback = {
                        onSuccess: function (msg) {
                            console.log("de register...");
                           
                        },
                        onFailure: function (err) {
                            console.log("failed to un register");
                        }
                    };
IMI.IMIconnect.unregister(unregisterCallback );

isRegistered

This method is used to check whether the user is currently registered with Webex Connect.

Syntax: boolean isRegistered()

Returns: Returns _true _if the user is registered, else _false _is returned.

var isRegistered = IMI.IMIconnect.isRegistered();

updateProfileData

This method is used to update userID and customerID parameters of current device profile registered with Webex Connect.

To update UserID

Syntax: IMI.IMIconnect.updateProfileData(IMI.ICDeviceProfileParam.UserId, newuserid, userIdcallbck);

Parameters:

ParameterTypeDescription
DeviceProfileParamIMI.ICDeviceProfileParam.UserIdSpecifies the user ID to register with Webex Connect.
newUserIdstringSpecifies the new user ID to register with Webex Connect.
userIdcallbackObjectRefer to example below.

To update CustomerID

Syntax: IMI.IMIconnect.updateProfileData(IMI.ICDeviceProfileParam.CustomerId, newcustomerid, customerCallback);

Parameters:

ParameterTypeDescription
DeviceProfileParamIMI.ICDeviceProfileParam.CustomerIdSpecifies the customer ID to register with Webex Connect.
newcustomerIdstringSpecifies the new customer ID to register with Webex Connect.
customerCallbackObjectRefer to example below.
var userIdcallbck = {
                    onSuccess: function (msg) {
                            console.log("usermodified...");
                            
                        },
                    onFailure: function (err) {
                            console.log("failed to add user");
                        }
                    };
IMI.IMIconnect.updateProfileData(IMI.ICDeviceProfileParam.UserId, "2130", userIdcallbck);
var customerCallback = {
                        onSuccess: function (msg) {
                            console.log("customer...");
                            $("#setCustomerModel").modal('hide');
                        },
                        onFailure: function (err) {
                            console.log("failed to add customer");
                            alert(err)
                        }
                    };
IMI.IMIconnect.updateProfileData(IMI.ICDeviceProfileParam.CustomerId, "2130", customerCallback);

removeProfileData

This method is used to remove the profile data (user ID or customer ID).

To Remove UserID

This method is used to remove the userID.

Syntax: IMI.IMIconnect.removeProfileData(IMI.ICDeviceProfileParam.UserId, removeUserCallback);

Parameters:

ParameterTypeDescription
DeviceProfileParamIMI.ICDeviceProfileParam.UserIdSpecifies the user ID to register with Webex Connect.
removeUserCallbackObjectRefer to example below.

To Remove customerID

This method is used to remove the userID.

Syntax: IMI.IMIconnect.removeProfileData(IMI.ICDeviceProfileParam.CustomerId, CustomerIdcallbck);

Returns: Returns customerId.

Parameters:

ParameterTypeDescription
DeviceProfileParamIMI.ICDeviceProfileParam.CustomerIdSpecifies the customer ID to register with Webex Connect.
customerIdcallbackCallbackRefer to example below.
var removeUserCallback = {
                        onSuccess: function (resrmsg) {
                            console.log("remove userId...");
                           
                        },
                        onFailure: function (err) {
                            console.log("failed to remove customerid..");
                        }
                    };
 IMI.IMIconnect.removeProfileData(IMI.ICDeviceProfileParam.UserId, userIdcallbck);
var CustomerIdcallbck = {
                        onSuccess: function (msg) {
                            console.log("usermodified...");
                            
                        },
                        onFailure: function (err) {
                            console.log("failed to add user");
                        }
                    };
 IMI.IMIconnect.removeProfileData(IMI.ICDeviceProfileParam.CustomerId,  customerCallback);

setSecurityToken

This method allows to specify the security token that the SDK will pass to the Webex Connect platform.

Syntax: setSecurityToken(token)

//generate token and call the below method using the token
 IMI.IMIconnect.setSecurityToken(token);

registerListener

This method has been deprecated. Please use registerSecurityTokenListener

This method allows registering an object which implements the onFailure method to listen for security token related exceptions which occur from internal (indirect) connect platform API calls.

Syntax: registerListener(callbackListener)

Parameters:

ParameterDescription
callbackListenerSecurity Token Exception listener object.
var callback= {
      onFailure: function () {
      console.log("token got expired...");
      alert("token got expired...");
//need to generate token your (for more information, refer to docs)                           }
  };
//this method should be called after startup()
 IMI.IMIconnect.registerListener(callback);

registerSecurityTokenListener

This method allows registering an object which implements the onFailure method to listen for security token related exceptions which occur from internal (indirect) connect platform API calls.

Syntax: registerSecurityTokenListener(callbackListener)

Parameters:

ParameterDescription
callbackListenerSecurity Token Exception listener object.
var callback= {
      onFailure: function () {
      console.log("token got expired...");
      alert("token got expired...");
//need to generate token your (for more information, refer to docs)                           }
  };
//this method should be called after startup()
 IMI.IMIconnect.registerSecurityTokenListener(callback);

unregisterListener

This method has been deprecated. Please use unRegisterSecurityTokenListener

This method allows unregistering a previously registered object in order to stop listening for security token exceptions.

Syntax: unregisterListener(callbackListener)

Parameters:

ParameterDescription
callbackListenerSecurity Token Exception listener object.
var callbackListener={
onFailure:function(error){
//This method will be called when security token issues comes
}
}
IMI.IMIconnect.unregisterListener(callback);

unRegisterSecurityTokenListener

This method allows unregistering a previously registered object in order to stop listening for security token exceptions.

Syntax: unRegisterSecurityTokenListener(callbackListener)

Parameters:

ParametersDescription
callbackListenerSecurity Token Exception listener object.
var callbackListener={
onFailure:function(error){
//This method will be called when security token issues comes
}
}
IMI.IMIconnect.unRegisterSecurityTokenListener(callback);

IMI.ICDeviceProfile

An ICDeviceProfile instance should be instantiated to register a device profile.
The developer can choose to register the device profile with a deviceId only or with a deviceId and an appUserId. Users' can generate their own device ID or can choose the default deviceId provided by the SDK.
If the user chooses to register a device profile with the deviceId only, then the backend will automatically generate an appUserId.
The current device profile is accessible via the Webex Connect class.

Public Methods
String getDefaultDeviceId()
String isAppUserSystemGenerated()
String getUserId()
String getDeviceId()

ICDeviceProfile()

The current device profile, which is accessible via the Webex Connect class.

Syntax: ICDeviceProfile(deviceId, userId)
Syntax: ICDeviceProfile(deviceId, userId, customerId, isSystemGenerated)

Parameters:

ParameterTypeDescription
deviceIdPropertySpecifies the device ID that is created in Webex Connect.
userIdPropertySpecifies the user ID that is created in Webex Connect.
customerIdPropertySpecifies the customer ID that is created in Webex Connect.
isSystemGeneratedPropertyIndicates if the device ID is system generated.

getDefaultDeviceId()

This method is used to get the value of default deviceId.

var deviceId=IMI.ICDeviceProfile.getDefaultDeviceId(); 
var deviceProfile =new IMI.ICDeviceProfile(deviceId, userId);
var deviceProfile =new IMI.ICDeviceProfile(deviceId, userId, customerId, isSystemGenerated);

isAppUserSystemGenerated()

This method is used to know whether the appuserId is generated by the end-system or the user.

Syntax: String isAppUserSystemGenerated()

Return Value: Returns the appuserid.

var deviceProfile =new IMI.ICDeviceProfile(deviceId, userId); 
var isAppUserSystemGenerated=deviceProfile.isAppUserSystemGenerated();      if(isAppUserSystemGenerated)
{ 
console.log("system generated appuser");
}

getUserId()

This method is used to get the user ID.

Syntax: String getUserId()

Return Value: Returns the userId.

getDeviceId()

This method is used to get the user ID.

Syntax: String getDeviceId()

Return Value: Returns the deviceId.

IMI.ICMediaFileManager

uploadFile

This method is used to check the status of the file upload.

Syntax: uploadFile(file, file.type, callback)

Return Value: Returns the file upload status.

onFileUploadComplete

This method is used to execute the callback method after the file upload is complete.

Syntax: onFileUploadComplete: function(file, mediaId, error, resp)

onFileUploadComplete: function(file, mediaId, error, resp){
      if(error){
             console.log(error);
       } else{
             $("#mediaid").val(mediaId);
             $('#imgPreviewThumb').src("data:image/png;base64," + resp.preview);
       }
}

setMediaId

This method is used to set the media id in the attachment section.

function pubMessage(threadtitle, threadid, msg, mediaId, callback){
----------------
----------------
if(mediaId && mediaId !==""){
         var mediaArr = [];
         var icAttach = new IMI.ICAttachment();
         icAttach.setMediaId(mediaId);
         mediaArray.push(icAttach);
        message.setAttachment(mediaArray);
}

Messaging

This module enables publication and receipt of In-app Messages and Push notifications. The usage of this module is optional.

This module has the following classes:

IMI.ICMessaging

The ICMessaging singleton class facilitates you to send and receive Live Chat / In-App Messaging messages and update the read status for Live Chat / In-App Messaging and Push.

deleteMessage

Use this method to delete the given message transaction id from the Webex Connect platform

ParameterDescription
messageTransactionIdTid of the message to be deleted

Syntax: deleteMessage(messageTransactionId, callback);

var callback = {
    onSuccess: function (tid) {
      debug("message deleted", tid);
    },
    onFailure: function (error) {
      debug("failed", error);
    },
  };
  
  
  var messaging = IMI.ICMessaging.getInstance();
    messaging.deleteMessage(tid, callback);

connect

This method is used to establish a connection to receive Real-Time Messages from the Webex Connect platform.
When the connection is successful, the status events are notified through ICMessagingReceiver.onConnectionStatusChanged.

📘

It throws an Exception if a user is not registered with Webex Connect or if the RTM feature is not enabled in the policy.

Syntax: connect()

var messaging = IMI.ICMessaging.getInstance();
try {
    messaging.connect();
} catch (error) {
    console.log(error)
}

disconnect

This method is used to disconnect the connection between the app and the Webex Connect platform. If there is no active connection, then this method fails silently.
When the disconnection is successful, the status events are notified through ICMessagingReceiver.onConnectionStatusChanged.

📘

The disconnect method throws an Exception if a user is not registered with Webex Connect or RTM feature is not enabled in the policy.

Syntax: disconnect()

var messaging = IMI.ICMessaging.getInstance();
try {
    messaging.disconnect();
} catch (error) {
    console.log(error)
}

fetchTopics

This method is used to get a list of topics that are configured with the Webex Connect app. Use the filter parameter to control the type of topics that are returned.

Results are reported through a callback.

Syntax: fetchTopics(filter, callback)

Parameters:

ParameterTypeDescription
filterICAccessLevelFilterRefer to ICAccessLevelFilter class.
callbackJSObjectSpecifies the callback object.
var messaging = IMI.ICMessaging.getInstance();
var callback = {
    onSuccess: function(ictopicslist) {
        console.log("success");
        //Write your logic to read topics and subscribe/unsubscribe/publish on those topics. 
        if (ictopicslist) {
            for (var i = 0; i < ictopicslist.length; i++) {
                var icTopic = ictopicslist[i];
                console.log(icTopic.getName());

            }

        }
    },
    onFailure: function(errormsg) {
        console.log("failed to get topics");
    }

};
messaging.fetchTopics(IMI.ICAccessLevelFilter.All, callback);

getConnectionStatus

This method is used to get the current connection status between the SDK and Webex Connect platform.

Syntax: ICConnectionStatus getConnectionStatus()

Return Value: Returns the current connection status between the SDK and the Webex Connect platform.

var messaging = IMI.ICMessaging.getInstance();
try {
    var connectionStatus = messaging.getConnectionStatus();
    if (connectionStatus == IMI.ICConnectionStatus.Connected) {
        //write your logic here
    }
} catch (error) {
    console.log(error)
}

getInstance

This method is used to get the ICMessaging singleton instance. The instance is created internally on demand.

Syntax: ICMessaging getInstance()

Return Value: Returns the ICMessaging singleton instance.

var messaging = IMI.ICMessaging.getInstance();

isConnected

This method is used to verify whether the RTM connection is established between SDK and Webex Connect. This is a convenience method for getConnectionStatus() == ICConnectionStatus.Connected.

Syntax: boolean isConnected()

Return Value: Returns _true _if the RTM connection is established between SDK and Webex Connect.

var messaging = IMI.ICMessaging.getInstance();
try {
    var isConnected = messaging.isConnected();
    if (isConnected) {
        //write your logic
    }
} catch (error) {
    console.log(error)
}

publishMessage

This method is used to publish the passed ICMessage instance through Live Chat / In-App Messaging connection.
The results of the operation are reported through a callback.

Syntax: publishMessage(message, callback)

*Parameters:**

ParametersTypeDescription
messageICMessage Refer to ICMessage class.
callbackJSObjectSpecifies the callback object.
var callback = {
    onSuccess: function() {
        console.log("message sent");
    },
    onFailure: function(errormsg) {
        console.log("failed to send message");
    }
};
 var messaging = IMI.ICMessaging.getInstance();
   var message = new IMI.ICMessage();

   message.setMessage("Test message");
   var thread = new IMI.ICThread();
   thread.setId("threadid <which is created using createThread()/came in Message>");
   thread.setTitle("cricket");
   thread.setStreamName("sports");
   message.setThread(thread);
   messaging.publishMessage(message, callback);

setMessageAsRead

This method is used to update the status of the message identified by transactionId as Read. The results of the operation are reported through a callback.

Syntax: setMessageAsRead(transactionId, callback)

Parameters:

ParameterTypeDescription
transactionIdstringSpecifies a single transaction id.
callbackJSObjectSpecifies the callback.
//To send single message read status back to <<prodname>>
var messageTransactionId = "<your message transaction id>";
var messaging = IMI.ICMessaging.getInstance();
var callback = {
    onSuccess: function() {
        console.log("success");

    },
    onFailure: function(errormsg) {
        console.log("failed ");
    }

};

messaging.setMessageAsRead(messageTransactionId, callback);

setMessagesAsRead

This method is used to update the status of the message identified by transactionIds as Read. The results of the operation are reported through a callback.

Syntax: setMessagesAsRead(transactionIds, callback)

Parameters:

ParameterTypeDescription
transactionIdsstring []Specifies an array of transaction ids.
callbackJSObjectSpecifies the callback object.
//To send mutliple messages read status back to <<prodname>>
var msgTransIds = ["transid1", "transid2", "transid3"];
var messaging = IMI.ICMessaging.getInstance();
var callback = {
    onSuccess: function() {
        console.log("success");

    },
    onFailure: function(errormsg) {
        console.log("failed ");
    }

};

messaging.setMessagesAsRead(msgTransIds, callback);

setICMessagingReceiver

This method is used to set ICMessagingReceiver callback. It contains two methods. When a message is received, ICMessagingReceiver.onMessageReceived method is called. When a connection status is changed ICMessagingReceiver.onConnectionStatusChanged method is called.
The results of the operation are reported through a callback.

Syntax: setICMessagingReceiver(callback)

Parameters:

ParameterTypeDescription
callbackICMessagingReceiverRefer to ICMessagingReceiver.
//To receive connect status changes and published messages
    var icMsgRecrCallback = new IMI.ICMessagingReceiver();
    icMsgRecrCallback.onConnectionStatusChanged = function(statuscode) {
        console.log("read the statuscode, based on the status do the operations");
            if (statuscode == IMI.ICConnectionStatus.Connected) {
             //Connected
             } else if (statuscode == IMI.ICConnectionStatus.Error) {
               //Error while connecting 
             }else if (statuscode == IMI.ICConnectionStatus.Refused) {
               //Connection lost
             } else {
                 //unknow error
             }
    };
    icMsgRecrCallback.onMessageReceived = function(icMessage) {
        //icMessage is IMI.ICMessage object
        if (icMessage.getType() === IMI.ICMessageType.Message) {
           //here direct message  came from server(message sent from api)
                   
          } else if (icMessage.getType() === IMI.ICMessageType.ReadReceipt) {                       
            //here read receipt came from another application for device syncing(read sent from another device)

          } else if (icMessage.getType() === IMI.ICMessageType.Republish) {
            //here repulished message came from another application for device syncing (message send from  another device)          
          }
    }
    
    var messaging = IMI.ICMessaging.getInstance();
    messaging.setICMessagingReceiver(icMsgRecrCallback);

subscribeTopic

This method is used to subscribe to the topic that has Read access level, allowing the SDK to receive messages on that topic.
The results of the operation are reported through a callback.

📘

Incoming messages are received through ICMessagingReceiver.onMessageReceived.

Syntax: subscribeTopic(topic, callback)

Parameters:

ParameterTypeDescription
topicstringSpecifies the topic name to subscribe.
callbackJSObjectSpecifies the callback.
//To subscribe to a topic
try {
    var messaging = IMI.ICMessaging.getInstance();

    var callback = {
        onSuccess: function() {
            console.log("success");

        },
        onFailure: function(errormsg) {
            console.log("failed ");
        }

    };
    var topic = "<Topic Name>";

    messaging.subscribeTopic(topic, callback);

} catch (error) {
    console.log(error)
}

unsubscribeTopic

This method is used to unsubscribe to the topic that has Read access level, preventing the SDK to receive messages on that topic. The messages may still be received until the callback has reported success.
The results of the operation are reported through a callback.

Syntax: unsubscribeTopic(topic, callback)

Parameters:

ParameterTypeDescription
topicstringSpecifies the topic name to unsubscribe.
callbackJSObjectSpecifies the callback.

callback = {
onSuccess: function(){
},
onFailure: function(){
}
};
//To unsubscribe to a topic
try {
    var messaging = IMI.ICMessaging.getInstance();

    var callback = {
        onSuccess: function() {
            console.log("success");

        },
        onFailure: function(errormsg) {
            console.log("failed ");
        }

    };
    var topic = "<Topic Name>";

    messaging.unsubscribeTopic(topic, callback);

} catch (error) {
    console.log(error)
}

createThread

This method is used to create a thread based on streamId and threadTitle and send the result in a callback.

Syntax: createThread(streamId, threadtitle, createThreadCallBack)

Parameters:

ParameterTypeDescription
streamIdstringIdentity of the stream.
threadTitlestringTitle of the thread.
callbackInvokes to report operation success or failure.
var createThreadCallBack = {
                        onSuccess: function (thread) 
                        {
                            console.log(thread);
                        },
                        onFailure: function () 
                        {
                            console.log("failed to create thread")
                        }
                    };
                    messaging.createThread(steamid, threadtitle, createThreadCallBack);

fetchThreads

This method is used to get a list of threads that are created and at least one message transaction completed. Results are reported through the callback.

Syntax: fetchThreads(offset, limit, callback)

Parameters:

ParameterTypeDescription
offsetstring (mandatory parameter)Pass offset value to fetch threads from that offset value.

Default value is 0.
limitIntegrer (mandatory parameter)Specifies the maximum number of items that can be returned in threads array.

Default value is 100.
callbackCallbackInvokes to report if operation is a success or failure.

Success callback returns an additional value, a positive value indicating more threads on the server.

unread_msg_count: Each thread object returns this based upon “server_inbox_version” in policy.

onFetchThreadsSuccess(threads, hasMoreThreads)
var messaging = IMI.ICMessaging.getInstance();
    messaging.fetchThreads(offset, limit, callback);

fetchMessages

This method is used to get a list of messages from the Webex Connect platform. All results are reported through the callback.

Syntax: fetchMessages(threadId, beforeDate, limit, callback)

Parameters:

ParameterTypeDescription
threadIdstringSpecifies the ThreadId value.
beforeDateDateSpecifies the date since the messages must be returned. This value is optional; if nothing is passed then it is considered as current Date Time.
limitIntegerSpecifies the maximum number of items that can be returned in messages array.

Default value is 100
calbackCallbackInvokes to report if operation is a success or failure.

totalCount: fetchMessagesCallback returns total number of messages for the userid/thread.

fetchMessagesSuccess(messages: any[], totalCount)
isOutgoingBooleanIndicates if the message is mobile originated if the value is true.
var messaging = IMI.ICMessaging.getInstance();
                    var messagesCallBack = {
                        onSuccess: function (messages) {
                        },
                        onFailure: function () {
                            console.log("failed to get messages");
                        }
                    };
                    messaging.fetchMessages(threadId, beforeDate, limit, callback);

fetchUnreadThreadCount

This method is used to get the count of threads that have unread messages.

Syntax: fetchUnreadThreadCount(callback)

Parameters:

ParameterTypeDecsription
callbackCallbackInvokes to report if operation is a success or failure.

Count: returns the unread thread count for user

fetchUnreadThreadCountSuccess(count)
var messaging = IMI.ICMessaging.getInstance();
    messaging.fetchUnreadThreadCount(callback);

getSDKVersion

This method gets the SDK version being used.

Syntax: getSDKVesrion()

Returns: string version of SDK

this.sdkVersion = "v" + IMIconnectPlugin.getSDKVersion();

getOutgoing

This method is used to get the list of outgoing messages.

Syntax: getOutgoing()

setOutgoing

This method is used to set the outgoing flag as true to indicate that the message is mobile originated.

Syntax: setOutgoing(true)

fetchStreams

This method is used to get a list of streams. All results are reported through the callback.

Syntax: fetchStreams(callback)

Parameters:

ParameterTypeDescription
callbackCallbackInvokes to report if operation is a success or failure.
var messaging = IMI.ICMessaging.getInstance();
                    var streamsCallBack = {
                        onSuccess: function (streams) {
                            //render streams
                        },
                        onFailure: function (error) {
                            alert("failed to get streams:");
                           
                        }
                    };
                    messaging.fetchStreams(streamsCallBack);

sendClickedEvent()

Use this method to send Clicked Event to Webex Connect platform

ParameterDescription
messageTransactionIdTID of the original message
icButtonThe ICButton instance that triggered this call
callbackThe callback sample code is provided in the below example

Sample Code:

var submitClickPostbackCallback = {
        onSuccess: (icButton) => {
            console.log(`"${icButton.getTitle()}" clicked!`);
        },
        onFailure: (errormsg) => {
            console.log(errormsg);
        },  
    };
messaging.sendClickedEvent(message.getTransactionId(), icButton, this.submitClickPostbackCallback

createPostbackMessage()

Creates ICMessage instance for Incoming message Interactive/Quick Replies button

ParameterDescription
icMessageOriginal Message object
icButtonThe ICButton instance that triggered this call

Sample Code:

var publishMessageCallback = 
    { onSuccess: (message) => { 
      //do something 
    }, 
     onFailure: (errormsg) => { 
       //do something 
     }, 
    }; 
let postbackQuickReplyMO = IMI.ICMessaging.getInstance().createPostbackMessage(message, icButton) 
messaging.publishMessage(postbackQuickReplyMO, 
                         publishMessageCallback);

IMI.ICMessagingReceiver

This class allows the interception of incoming messages and RTM connection status changes. The default class provides standard message handling. You must invoke setICMessagingReceiver to set ICMessagingReceiver callback.

onConnectionStatusChanged

This method is invoked whenever there is a change to the RTM connection status.

Syntax: onConnectionStatusChanged(status)

Parameters:

ParameterTypeDescription
statusICConnectionStatusRefer to ICConnectionStatus class.

onMessageReceived

This method is invoked whenever a new RTM message is received.

Syntax: onMessageReceived(message)

Parameters:

ParameterTypeDescription
messageICMessageRefer to ICMessage class.

IMI.ICMessage

This class exposes message data from RTM and Push channels in a generalized form and is also used to send Real-Time Messages from an app to the Webex Connect platform.

Parameters:

getCategory

This method is used to get the category of the interactive message.

Syntax: String getCategory()

Return Value: Returns the category of the message.

getChannel

This method is used to get the channel on which the message was received.

Syntax: String getChannel()

Return Value: Returns the channel.

getCustomTags

This method is used to get the custom or developer specified data that was sent as part of the message payload.

Syntax: JSObject getCustomTags()

Return Value: Returns the custom tags sent along with the message payload.

getExtras

This method is used to get the supplementary data that was sent as part of the message payload. The format of this data is controlled by the Webex Connect platform.

Syntax: JSObject getExtras()

Return Value: Returns the supplementary data that was sent along with the message payload.

getMedia

This method is used to get the media files that are attached to the message.

Syntax: IMI.ICMediaFile[] getMedia()

Return Value: Returns the media files that ware attached to the message.

getMessage

This method is used to get the content of the message that is displayed to the end-users.

Syntax: String getMessage()

Return Value: Returns the text message that is displayed to the end-users.

getReplyTo

This method is used to get the topic to which the reply should be sent. This method is not applicable to Push messaging.

Syntax: String getReplyTo()

Return Value: Returns the topic to which reply should be sent.

getSenderId

This method is used to get the senderId an arbitrary identifier that is set by the sender of the message. This method is not applicable to Push messaging.

Syntax: String getSenderId()

Return Value: Returns the senderid of the message.

getTopic

This method is used to get the topic on which the message was received. This method is not applicable to Push messaging.

Syntax: String getTopic()

Return Value: Returns the topic on which the message was received.

getTransactionId

This method is used to get the transaction id that uniquely identifies the message transaction within the Webex Connect platform.

Syntax: String getTransactionId()

Return Value: Returns the transaction id that identifies the message transaction.

getUserId

This method is used to get the user id from which the message is originated. This method is not applicable to Push messaging.

Syntax: String getUserId()

Return Value: Returns the user id from which the message is originated.

setCustomTags

This method is used to set the custom tags object to be sent with an outgoing RTM. This method is not applicable to Push messaging.

Syntax: setCustomTags(tags)

Parameters:

ParameterTypeDescription
tagsJSObjectSpecifies the JSObject.

setMedia

This method is used to set the media file attachments to be sent with an outgoing RTM. This method is not applicable to Push messaging.

Syntax: setMedia(files)

Parameters:

ParameterTypeDescription
filesIMI.ICMediaFileRefer to IMI.ICMediaFile class

setMessage

This method is used to set the content of the text message to be sent with an outgoing RTM. This method is not applicable to Push messaging.

Syntax: setMessage(message)

Parameters:

ParameterTypeDescription
messagestringSpecifies the content of the text message.

setSenderId

This method is used to set the senderid to be sent with an outgoing RTM. This is arbitrary information such as a simple tag. This method is not applicable to Push messaging.

Syntax: setSenderId(senderId)

Parameters:

ParameterTypeDescription
senderIdstringSpecifies the sender id.

setTopic

This method is used to set the topic on which the message should be published. This method is not applicable to Push messaging.

Syntax: String setTopic(topic)

Parameters:

ParameterTypeDescription
topicstringSpecifies the topic.

getAttachments

This method is used to get the attachment files that are attached to the message.

Syntax: ICAttachment[] getAttachments()

Return Type: Returns the attachment files attached to the message.

getThread

This method is used to get the thread details specified in the message.

Syntax: ICThread getThread()

Return Type: Returns the thread details that were specified in the message.

getSubmitted

This method is used to get the message submitted date to the Webex Connect platform.

Syntax: Date getSubmittedAt()

Return Type: Returns the message submitted date to the Webex Connect platform.

getDelivered

This method is used to get the message delivered date to the device.

Syntax: Date getDeliveredAt()

Return Type: Returns the message delivered date to the device.

getReadAt

This method is used to get the message read date at the device.

Syntax: Date getReadAt()

Return Type: Returns the message read date at the device.

getType

This method is used to get the message type.

Syntax: ICMessageType getType()

Return Type: Returns the message type.

setAttachments

This method is used to set the media file attachments to be sent with an outgoing RTM. This method is not applicable to Push messaging.

Syntax: setAttachments(final ICAttachment[] attachments)

Parameters:

ParameterTypeDescription
attachmentsRefer to ICAttachment class.

setThread

This method is used to set the thread details that need to be specified in the message.

Syntax: setThread(final ICThread thread)

Parameters:

ParameterTypeDescription
threadRefer to ICThread class.

setRelatedTransactionId

Use the property to set related transaction ID while submitting a form response.

Syntax: ICMessage.setRelatedTransactionId(relatedTransactioId)

message.setThread(this.thread);    
message.setRelatedTransactionId(formMT.getTransactionId());

getRelatedTransactionId

This method returns a relatedTransactionID which can be used to identify original Form MO.

Syntax: ICMessage. getRelatedTransactionId()

Returns: String

getInteractiveData()

This method returns details about the form-response.

📘

Note

This does not return the actual form response details.

Syntax: ICMessage.getInteractiveData()

Returns: ICInteractiveData object

IMI.ICMediaFile

This class is deprecated.
This class exposes data relating to media file attachments that are received through RTM and used to attach media files to outgoing messages.

Public Methods
String getContentType()
long getDuration()
double getLatitude()
double getLongitude()
String getPreview()
long getSize()
String getURL()
setContentType(contentType)
setDuration(duration)
setLatitude(latitude)
setLongitude(longitude)
setPreview(preview)
setSize(size)
setURL(url)

getContentType()

This method is used to get the content type such as image/jpeg.

Syntax: String getContentType()

Return Value: Returns the content type such as image or jpg.

getDuration()

This method is used to get the duration of the applicable audio and video files.

Syntax: long getDuration()

Return Value: Returns the duration of the audio and video files.

getLatitude()

This method is used to get the latitude of the location passed in a message.

Syntax: double getLatitude()

Return Value: Returns the latitude of the location.

getLongitude()

This method is used to get the longitude of the location passed in a message.

Syntax: double getLongitude()

Return Value: Returns the longitude of the location.

getPreview()

This method is used to get the preview thumbnail as a string.

Syntax: String getPreview()

Return Value: Returns the preview thumbnail as a string.

getSize()

This method is used to get the file size in bytes.

Syntax: long getSize()

Return Value: Returns the file size in bytes.

getURL()

This method is used to get the URL of the media file.

Syntax: String getURL()

Return Value: This method returns the URL.

setContentType()

This method is used to set the content type such as image/jpeg.

Syntax: setContentType(contentType)

Parameters:

ParameterTypeDescription
contentTypestringSpecifies the content type.

setDuration()

This method is used to set the duration of the audio and video files.

Syntax: setDuration(duration)

Parameters:

ParameterTypeDescription
durationlongSpecifies the duration in milliseconds.

setLatitude()

This method is used to set the latitude of the location passed in a message.

Syntax: setLatitude(latitude)

Parameters:

ParameterTypeDescription
latitudedoubleSpecifies the latitude of the location.

setLongitude()

This method is used to set the longitude of the location passed in a message.

Syntax: setLongitude(longitude)

Parameters:

ParameterTypeDescription
longitudedoubleSpecifies the longitude of the location.

setPreview()

This method is used to set the preview of the media file.

Syntax: setPreview(preview)

Parameters:

ParameterTypeDescription
previewstringSpecifies the preview of the media file.

setSize()

This method is used to set the size of the file in bytes.

Syntax: setSize(size)

Parameters:

ParameterTypeDescription
sizelongSpecifies the size of the file in bytes.

setURL()

This method is used to set the URL of the media file.

Syntax: setURL(url)

Parameters:

ParameterTypeDescription
urlstringSpecifies the URL for the media.

IMI.ICAttachment

This class exposes data relating to media file attachments that are received through RTM and used to attach media files to outgoing messages.

Public Methods
String getContentType()
long getDuration()
double getLatitude()
double getLongitude()
String getPreview()
long getSize()
String getURL()
setContentType(contentType)
setDuration(duration)
setLatitude(latitude)
setLongitude(longitude)
setPreview(preview)
setSize(size)
setURL(url)

getContentType

This method is used to get the content type such as image/jpeg.

Syntax: String getContentType()

Return Value: Returns the content type such as image or jpg.

getDuration

This method is used to get the duration of the applicable audio and video files.

Syntax: long getDuration()

Return Value: Returns the duration of the audio and video files.

getLatitude

This method is used to get the latitude of the location passed in a message.

Syntax: double getLatitude()

Return Value: Returns the latitude of the location.

getLongitude

This method is used to get the longitude of the location passed in a message.

Syntax: double getLongitude()

Return Value: Returns the longitude of the location.

getPreview

This method is used to get the preview thumbnail as a string.

Syntax: String getPreview()

Return Value: Returns the preview thumbnail as a string.

getSize

This method is used to get the file size in bytes.

Syntax: long getSize()

Return Value: Returns the file size in bytes.

getURL

This method is used to get the URL of the media file.

Syntax: String getURL()

Return Value: This method returns the URL.

setContentType

This method is used to set the content type such as image/jpeg.

Syntax: setContentType(contentType)

Parameters:

ParameterTypeDescription
contentTypestringSpecifies the content type.

setDuration

This method is used to set the duration of the audio and video files.

Syntax: setDuration(duration)

Parameters:

ParameterTypeDescription
durationlongSpecifies the duration in milliseconds.

setLatitude

This method is used to set the latitude of the location passed in a message.

Syntax: setLatitude(latitude)

Parameters:

ParameterTypeDescription
latitudedoubleSpecifies the latitude of the location.

setLongitude

This method is used to set the longitude of the location passed in a message.

Syntax: setLongitude(longitude)

Parameters:

ParameterTypeDescription
longitudedoubleSpecifies the longitude of the location.

setPreview

This method is used to set the preview of the media file.

Syntax: setPreview(preview)

Parameters:

ParameterTypeDescription
previewstringSpecifies the preview of the media file.

setSize

This method is used to set the size of the file in bytes.

Syntax: setSize(size)

Parameters:

ParameterTypeDescription
sizelongSpecifies the size of the file in bytes.

setURL

This method is used to set the URL of the media file.

Syntax: setURL(url)

Parameters:

ParameterTypeDescription
urlstringSpecifies the URL for the media.

IMI.ICTopic

This class exposes Real Time Messaging topic data that is used to publish outgoing messages or subscribe to receive incoming messages.

getAccessLevel

This method is used to get the access level assigned to the topic.

Syntax: IMI.ICAccessLevel getAccessLevel(level)

Return Value: Returns the access level assigned to the topic.

getCreatedBy

This method is used to get name who created the topic.

Syntax: String getCreatedBy()

Return Value: Returns the name who created the topic.

getCreatedDate

This method is used to get the date on which the topic is created.

Syntax: Date getCreatedDate()

Return Value: Returns the date on which the topic is created.

getName

This method is used to get the topic name.

Syntax: String getName()

Return Value: Returns the topic name.

getUpdatedDate

This method is used to get the date on which the topic was last updated.

Syntax: Date getUpdatedDate()

Return Value:Returns the date on which the topic was last updated.

isSubscribed

This method is used to verify whether the current user is subscribed to the topic.

*Syntax:** Boolean isSubscribed()

Return Value: Returns true if the current user is subscribed to the topic.

IMI.ICThread

This class exposes the thread data from the In-app channel in a generalized form. It is also used to send In-app from an app to the Webex Connect platform.

Public Methods
String getId
String getTitle
boolean isWritable
String getStreamName
Date getCreatedAt
Date getUpdatedAt
JSON setExtras
JSON getExtras
Number getUnreadMessageCount

getId

This method is used to get thread ID information.

Syntax: String getId()

Return Value: Returns the thread ID information.

getTitle

This method is used to get the thread title.

Syntax: String getTitle()

Return Value: Returns the thread title.

isWritable

This method is used to validate if a thread is writable or not. A thread is writable for Conversation thread, else (for announcement) thread it is not writable.

Syntax: boolean isWritable()

Return Value: Returns whether the thread is writable or not.

getStreamName

This method is used to get the stream name to communicate to the Webex Connect platform.

Syntax: String getStreamName()

Return Value: Returns the stream name.

getCreatedAt

This method is used to get the thread created date on the Webex Connect platform.

Syntax: Date getCreatedAt()

Return Value: Returns the thread created date on the Webex Connect platform.

getUpdatedAt

This method is used to get the thread updated date on the Webex Connect platform.

Syntax: Date getUpdatedAt()

Return Value: Returns the thread updated date on the Webex Connect platform.

setExtras

This method is used to set extra data to be associated with the thread.

Syntax: JSON setExtras(extras) //accepts any JSON object

getExtras

This method is used to get the thread updated date on the Webex Connect platform.

Syntax: JSON getExtras()

Return Value: Returns the extra data associated with the thread.

getUnreadMessageCount

This method returns the count of unread messages.

Syntax: getUnreadMessageCount()

Return Value: Returns the count of unread messages.

setReasonForStatusChange

Provide reason for changing status.

Syntax: ICThread.setReasonForStatusChange(reason);

ParametersDescription
reasonstring

getReasonForStatusChange()

Returns reason if provided while changing status of the ICThread object.

Syntax: ICThread.getReasonForStatusChange()

thread.setReasonForStatusChange(reason);
  messaging.closeThread(thread, closeThreadCallBack);

Push Messaging

The push notification service allows you to send messages to web applications from Webex Connect. The notifications are sent to the user’s home screen or to the notification tray. The push notifications are useful for prompting immediate interaction and engaging users that are not currently active in your app.

In-app (Real-Time) Messaging

The Real-Time Messaging (RTM) service allows you to deliver simple messages to the users' application. It uses the publish and subscribe messaging pattern. The senders of the messages are called publishers. The receivers of the messages are called subscribers. The publishers do not program the messages to be sent directly to specific receivers. Instead, they publish the messages to topics.

The app users can subscribe to specific topics. The messages published to specific topics are received by the app users who are subscribed to those topics.

The Webex Connect SDK uses Message Queuing Telemetry Transport (MQTT) protocol to connect with Webex Connect Message Broker and uses publish and subscribe messaging pattern to exchange messages through Webex Connect Message Broker.

All web apps using the Webex Connect SDK are connected to a Message Broker cluster subscribe to a unique channel (user id).

You can use the Webex Connect profile API to query the status of user connection whether connected or disconnected and send relevant messages.

For example, on a banking website, if a customer wishes to interact with a customer service team, you can integrate a chat or customer service feedback functionality using In-app Messaging on your website.

IMI.ICFormField

This class represents formField data for form attachment

getType

This method is used to get the ICFormFieldType of the object

Syntax:getType()

Returns: ICFormFieldType object

setType

This method sets the type of the FormField.

Syntax:setType(ICFormFieldType type)

ParametersDescription
typetype of the formField

getName

This method is used to get the formField name

Syntax: getName()

Returns: formField name

setName

This method is used to set the formField name

Syntax: setName(name)

ParametersDescription
labelstring

getLabel

This method is used to get the formField label. Label can be used as display text for the field.

Syntax: getLabel()

Returns: label: String

setLabel

This method is used to set the formField label.

Syntax: setLabel(label)

ParametersDescription
labelstring

getValue

This method is used to get the formField Value

Syntax: getValue()

Returns: Value as submitted by the user

setValue

This method is used to set the value of FormField

Syntax: setValue(value)

ParametersDescription
valuestring

getDescription

This method is used to get the formField description

Syntax: getDescription()

Returns: string

setDescription

This method is used to set the description of FormField

Syntax: setDescription(description)

ParametersDescription
descriptionstring

getMandatory

This method returns whether it is mandatory for user to fill FormField value.

Syntax: getMandatory()

Returns: Bool

setMandatory

This method sets whether it is mandatory to fill form field value or not.

Syntax: setMandatory(value)

ParametersDescription
valuebool true or false

setOptions

This method sets options for FormField type "dropdown"

Syntax: setOptions(options)

ParametersDescription
optionsoptions array for formField Type "dropdown"

getOptions

This method is used to get the options for FormField type "Dropdown"

Syntax: getOptions()

Returns: options array for formField Type "dropdown"

fromJSON

Instantiates a new ICFormField instance from the supplied JSONObject.

Syntax: fromJSON(jsonObj)

Returns: A new ICFormField or null if jsonObj is null

ParametersDescription
jsonObjectA valid JSONObject instance containing form field data

IMI.ICInteractiveData

This class represents the data for user interaction on message.

ReturnsMethodParametersDescription
setIdentifierstringSets unique button Identifier
stringgetIdentifierReturns the unique button identifier
setRelatedTransactionIdstringSets the transaction id that uniquely identifies original template ICMessage
stringgetRelatedTransactionIdGets the transaction id that uniquely identifies original template ICMessage
stringgetTitleReturns the button Title
setTitlestringSet the button title for interactive data
stringgetReferenceReturns the unique reference id for button
setReferencestringSets the unique reference id for button
stringgetActionURLReturns the action url property of button
setActionURLstringSets the action url property of button

Methods

Return TypeMethod Name
Date()getSubmittedAt()
setSubmittedAt(submittedAt)
setType(ICInteractiveDataType type)
ICInteractiveDataTypegetType()
stringgetTid()
setTid(tid)
JSON ObjectgetPayload()
JSON ObjecttoJSON()
ICInteractiveDatafromJSON(jsonObj)

getSubmittedAt

Returns the date on which the interaction data was submitted to the Webex Connect platform.

Syntax: getSubmittedAt()

Returns: Date() object

setSubmittedAt

Sets the date on which the interaction data was submitted to the Webex Connect platform

Syntax: setSubmittedAt(submittedAt)

ParametersDescription
submittedAtdate

setType

This method sets the type of the Interactive Data

Syntax: setType(ICInteractiveDataType type)

ParametersDescription
typetype of the ICInteractiveDataType

getType

This method is used to get the ICInteractiveDataType for the message

Syntax: getType()

Returns: ICInteractiveDataType object

getTid

This method gets the transaction id that uniquely identifies the form response message.

Syntax: getTid()

Returns: String

setTid

This method sets the transaction id for form response message.

Syntax: setTid(tid)

ParametersDescription
tida string transaction id that uniquely identifies the form response message

getPayload

This method gets interactive payload data

Syntax: getPayload()

Returns: JSON Object

toJSON

This method returns a new JSONObject instance containing message interactive data.

Syntax: toJSON()

Returns: JSON Object

fromJSON

Instantiates a new ICInteractiveData instance from the supplied JSONObject.

Syntax: fromJSON(jsonObj)

Returns: A new ICInteractiveData object

IMI.ICFormTemplateAttachment

This class represents Form template attachment.

This class represents Form template attachment.

getTitle()

This method returns the form template attachment title.

Syntax: getTitle()

Returns: string

setTitle()

This method Sets the form template attachment title

Syntax: setTitle(title)

Parameters:

ParametersDescription
titleform template attachment title

setReference()

This method is used to set the value of Reference property

Syntax: setReference(value)

Parameters:

ParameterTypeDescription
valueStringValue to be set as Reference

getReference()

This method is used to get the value of Reference property

Returns: string

Syntax: getReference()

getFields()

This method returns list of form field data.

Syntax: getFields()

Returns: Array of IMI.ICFormField objects

getValues()

This method is used to get values for field type MultiSelectDropdown.

Syntax: icFormField.getValues()

Returns: Array of values

setValues()

This method is used to set the values for FormField of type MultiSelectDropdown.

Syntax: icFormField.setValues(values);

ParameterDescription
valuesArray

setFields()

This method sets array of form field data

Syntax: setFields(fields[])

ParametersDescription
fieldslist of form field data

getContentType()

This method gets content type of attachment

Syntax: getContentType()

Returns: IMI.ICContentType value

setContentType()

This method sets the contentType

Syntax: setContentType(type)

ParametersDescription
TypeIMI.ICContentType

getTemplateType()

This method is used to get the template type

Syntax: getTemplateType()

Returns: ICTemplateType

setTemplateType()

Syntax: setTemplateType(templateType)

ParametersDescription
templateTypeICTemplateType

getTemplateId()

This method returns the template Id .

Syntax: getTemplateId()

Returns: Returns the Id for the template

setTemplateId()

This method sets the template Id

Syntax: setTemplateId(templateId)

ParametersDescription
templateIdthe Id for the template

toJSON()

This method returns a new JSONObject instance containing form template attachment data.

Syntax: toJSON()

Returns: A JSONObject representation of the form template attachment data.

fromJSON()

Instantiates a new ICFormTemplateAttachment instance from the supplied JSONObject.

Syntax: fromJSON(jsonObj)

Returns: A new ICFormTemplateAttachment or null if jsonObj is null.

ParametersDescription
jsonObjectA valid JSONObject instance containing form template attachment data.

startupLogger

By default, all logs are disabled. For debugging purpose, logs can be enabled by calling this method. Call this method before calling sdk startup().

Syntax: IMI.IMIconnect.startupLogger();

IMI.ICGenericTemplateAttachment

This class exposes Template data

Return TypeMethod Name
setReference()
stringgetReference()
stringgetContentType()
IMI.ICTemplateTypegetTemplateType()
IMI.ICGenericTemplateElement[]getElements()
toJSON()

setReference()

This method is used to set the value of Reference property

Syntax: setReference()

Parameters:

ParameterTypeDescription
valuestringValue to be set as Reference

getReference()

This method is used to get the value of Reference property

Syntax: getReference()

Returns: string

getContentType()

This method is used to get the value of ContentType property

Syntax: getContentType()

Returns: string

getTemplateType()

This method is used to get the value of TemplateType property

Syntax: getTemplateType()

Returns: IMI.ICTemplateType

getElements()

This method is used to get the value of Elements property

Syntax: getElements()

Returns: IMI.ICGenericTemplateElement[]

toJSON()

This method returns a new JSONObject instance containing all data

Syntax: toJSON()

IMI.ICGenericTemplateElement

Return TypeMethod Name
stringgetTitle()
stringgetSubtitle()
stringgetImageURLs()
IMI.ICButton[]getButtons()
toJSON()

getTitle()

Returns the title of the Element object.

Returns: string

Syntax: getTitle()

getSubtitle()

This method is used to get the value of Subtitle property

Returns: string

Syntax: getSubtitle()

getImageURLs()

This method is used to get the images associated with an element.

Returns: string[]

Syntax: getImageURLs()

getButtons()

Returns the buttons associated with the element object.

Returns: IMI.ICButton[]

Syntax: getButtons()

toJSON()

This method returns a new JSONObject instance containing all data

Syntax: toJSON()

IMI.ICButton

Return TypeMethod Name
IMI.ICInteractiveDataTypegetType()
stringgetIdentifier()
stringgetImageURL()
stringgetActionURL()
stringgetTitle()
stringgetPayload()
toJSON()

getType()

Returns the type of Button object.

Returns: IMI.ICInteractiveDataType

Syntax: getType()

getIdentifier()

Returns the unique identifier for this button

Returns: string

Syntax: getIdentifier()

getImageURL()

This method is used to get the value of ImageURL property for this button

Returns: string

Syntax: getImageURL()

getActionURL()

This method is used to get the value of ActionURL property

Returns: string

Syntax: getActionURL()

getTitle()

This method is used to get the value of Title property

Returns: string

Syntax: getTitle()

getPayload()

This method is used to get the value of Payload property

Returns: string

Syntax: getPayload()

toJSON()

This method returns a new JSONObject instance containing all data

Syntax: toJSON()

IMI.ICQuickReplyData

This class contains the quick reply options associated with an ICMessage object

Return TypeMethod Name
VoidsetReference(val)
stringgetReference()
setButtons(val)
IMI.ICButton[]getButtons()
toJSON()

setReference()

Sets the unique reference identifier for the quick-reply options

Parameters: value: string

Syntax: setReference(val)

getReference()

Gets the unique reference identifier for the quick-reply options

Returns: string

Syntax: getReference()

setButtons(val)

This method is used to set the value of Buttons

Parameters: IMI.ICButton[]

Syntax: setButtons(val)

getButtons()

Returns the buttons available with this quick reply data

Returns: IMI.ICButton[]

Syntax: getButtons()

toJSON()

This method returns a new JSONObject instance containing all data

Syntax: toJSON()