{
threadId, // id of the conversation. Also known as streamId or conversationId
userCount, // number of users returned
isCrossPod, // if cross pod, returns true
isDeactivated, // if an IM has been deactivated, returned on IMs only
user : { // user information
id, // user identifier
emailAddress, // user email
username, // user name
displayName, // user display name
firstName, // user first name
lastName, // user last name
phone, // user phone number
mobile, // user mobile phone number
isDeactivated, // user is deactivated, returned for profile only
},
}// The application service that willbe used to handle clicks on UI extensions
var helloControllerService = SYMPHONY.services.register("hello:controller");
// Displays a button on 1-1 instant messages
uiService.registerExtension(
"single-user-im",
"hello-im",
"hello:controller",
{
label: "IM Button",
data: {"datetime": Date()}
}
);
// Implement the trigger method on your application service
helloControllerService.implement({
trigger: function(uiClass, id, payload, data) {
if (uiClass == "single-user-im") {
console.log('IM button was clicked on ' + data.datetime + '.');
// This acquires the user's phone number from the payload
var userPhone = payload.user.phone;
// You can do this for any field in the prior section, such as emailAddress
var userEmail = payload.user.emailAddress;
// You can now pass the user's phone number and email to your system.
}
}
});{
isCopyDisabled, //if copy is disabled in the room returns true
isWriteAllowed, //if the user can send a message in the room, returns true
isCrossPod, //if it is a cross pod room, returns true
roomName, //room name
threadId, //id of the conversation. Also known as streamId or conversationId
userCount, //number of users returned
users : [ { //users information
id, //user id
isCrossPodUser, //if this is a cross pod user, returns true
isOwner, //if the user is owner of the room, returns true
emailAddress, //user email
username, //user name
displayName, //user display name
firstName, //user first name
lastName, //user last name
phone, //user phone number
mobile, //user mobile phone number
}]
}{
isCopyDisabled,
isWriteAllowed,
isCrossPod,
roomName,
threadId,
userCount
}// To use the ui service, you must subscribe to it from your application
var uiService = SYMPHONY.services.subscribe("ui");function openIMbyStreamID(streamID, messageId)function openIMbyUserIDs(userIds)function registerExtension(uiClass, id, serviceName, options)// The application service that will be used to handle clicks on UI extensions
var helloControllerService = SYMPHONY.services.register("hello:controller");
// The application service that will handle the filter on UI extensions
var helloFilterService = SYMPHONY.services.register("hello:filter");
// Displays a button in the header of 1-1 chats
uiService.registerExtension(
"single-user-im",
"hello-im",
"hello:controller",
{
label: "IM Button",
data: {"datetime": Date()}
}
);
// Implement the trigger method on your application service
helloControllerService.implement({
trigger: function(uiClass, id, payload, data) {
if (uiClass == "single-user-im") {
console.log('IM button was clicked on ' + data.datetime + '.');
}function unregisterExtension(uiClass, id)uiService.unregisterExtension('single-user-im', 'hello-im');var uiService = SYMPHONY.services.subscribe("ui");
uiService.listen("themeChangeV2", function() {
themeColor = data.themeV2.name;
themeSize = data.themeV2.size;
// Styling is achieved by specifying the appropriate classes on the app module's body element.
document.body.className = "symphony-external-app " + themeColor + " " + themeSize;
});// Implement the filter function on your application service
helloFilterService.implement(
filter: function (type, id, data) {
return !!(data.user && data.user.phone);
}
}
});