1.x
The Cisco Webex JS SDK
npm install --save webex
All of the examples in these API docs assume you've gotten an authenticated Webex instance (unless otherwise specified) using one of the methods below.
webex
has three basic modes of operation:
This is the quickest way to get up and running with our JavaScript SDK. Simply set the environment variable WEBEX_ACCESS_TOKEN
to your access token and add the following line at the top of your JavaScript file to get a ready-to-use instance.
You can get your
WEBEX_ACCESS_TOKEN
from the Cisco Webex for Developers portal.
const webex = require(`webex/env`);
webex/env
is also a great way to get started with bots.
Our JavaScript SDK provides out-of-the-box support for the OAuth 2.0 Implicit Grant Flow.
You'll need to register an OAuth Client to get your "authorization string"
Use the steps under Bundling (or something similar) to get the SDK into your browser, then use the following JavaScript to get started:
const webex = Webex.init({
config: {
authorizationString: <your auth URL>,
}
});
webex.once(`ready`, () => {
if (webex.canAuthorize) {
/* Your application code goes here */
}
else {
/* Your login code goes here */
/*
The following is a naive example of how to log in a user. Note that login should probably require a user action, otherwise errors can lead you into an infinite redirect loop.
This will direct the user agent to the Cisco login page. Once the user logs in, they'll be redirected back to your app and the SDK will handle parsing the URL.
*/
webex.authorization.initiateLogin();
}
});
You'll need to bundle the SDK to use it in a web browser. Right now, we do all our SDK testing with Browserify, but our Cisco Webex Widgets use webpack.
The following snippet is the bare minimum to get our code into a form suitable for a web browser. You'll probably want to additionally pipe it through a minifier like UglifyJS before going to production.
npm install webex
npm install -g browserify
echo "window.webex = require('webex')" > ./index.js
browserify index.js > bundle.js
Then, just load your bundle using:
<script src="/bundle.js"></script>
Though the implicit flow is great for single page apps, it's not ideal for integrations that might need to do things on your users' behalf months in the future. We additionally support the OAuth 2.0 Authorization Code Grant flow, but due to its complexity, there's a bit you'll need to wire up in your app to take advantage of it. The following is an example of how an Express app might do authentication.
var Webex = require('webex');
const assert = require(`assert`);
app.use(function(req, res, next) {
req.webex = Webex.init({
config: {
credentials: {
authorizationString: <your auth URL>,
client_secret: <your client secret>
},
}
});
req.webex.once(`ready`, next);
});
app.get(`/login`, (req, res) => {
// buildLoginUrl() defaults to the implicit grant flow so explicitly pass
// `confidential` to generate a URL suitable to the Authorization Code grant
// flow.
res
.redirect(req.webex.credentials.buildLoginUrl({clientType: 'confidential'}))
.end();
});
app.get(`/oauth/redirect`, (req, res, next) => {
assert(req.params.code);
req.webex.requestAuthorizationCodeGrant(req.params)
.then(() => {
res.redirect(`/`).end();
})
.catch(next);
});
The Cisco Webex JS SDK
npm install --save webex
All of the examples in these API docs assume you've gotten an authenticated Webex instance (unless otherwise specified) using one of the methods below.
webex
has three basic modes of operation:
This is the quickest way to get up and running with our JavaScript SDK. Simply set the environment variable WEBEX_ACCESS_TOKEN
to your access token and add the following line at the top of your JavaScript file to get a ready-to-use instance.
You can get your
WEBEX_ACCESS_TOKEN
from the Cisco Webex for Developers portal.
const webex = require(`webex/env`);
webex/env
is also a great way to get started with bots.
Our JavaScript SDK provides out-of-the-box support for the OAuth 2.0 Implicit Grant Flow.
You'll need to register an OAuth Client to get your "authorization string"
Use the steps under Bundling (or something similar) to get the SDK into your browser, then use the following JavaScript to get started:
const webex = Webex.init({
config: {
authorizationString: <your auth URL>,
}
});
webex.once(`ready`, () => {
if (webex.canAuthorize) {
/* Your application code goes here */
}
else {
/* Your login code goes here */
/*
The following is a naive example of how to log in a user. Note that login should probably require a user action, otherwise errors can lead you into an infinite redirect loop.
This will direct the user agent to the Cisco login page. Once the user logs in, they'll be redirected back to your app and the SDK will handle parsing the URL.
*/
webex.authorization.initiateLogin();
}
});
You'll need to bundle the SDK to use it in a web browser. Right now, we do all our SDK testing with Browserify, but our Cisco Webex Widgets use webpack.
The following snippet is the bare minimum to get our code into a form suitable for a web browser. You'll probably want to additionally pipe it through a minifier like UglifyJS before going to production.
npm install webex
npm install -g browserify
echo "window.webex = require('webex')" > ./index.js
browserify index.js > bundle.js
Then, just load your bundle using:
<script src="/bundle.js"></script>
Though the implicit flow is great for single page apps, it's not ideal for integrations that might need to do things on your users' behalf months in the future. We additionally support the OAuth 2.0 Authorization Code Grant flow, but due to its complexity, there's a bit you'll need to wire up in your app to take advantage of it. The following is an example of how an Express app might do authentication.
var Webex = require('webex');
const assert = require(`assert`);
app.use(function(req, res, next) {
req.webex = Webex.init({
config: {
credentials: {
authorizationString: <your auth URL>,
client_secret: <your client secret>
},
}
});
req.webex.once(`ready`, next);
});
app.get(`/login`, (req, res) => {
// buildLoginUrl() defaults to the implicit grant flow so explicitly pass
// `confidential` to generate a URL suitable to the Authorization Code grant
// flow.
res
.redirect(req.webex.credentials.buildLoginUrl({clientType: 'confidential'}))
.end();
});
app.get(`/oauth/redirect`, (req, res, next) => {
assert(req.params.code);
req.webex.requestAuthorizationCodeGrant(req.params)
.then(() => {
res.redirect(`/`).end();
})
.catch(next);
});
See Browser Guide and Server Guide
Create a new Webex instance
Webex
:
Create a new Webex instance configured for your OAuth client
const webex = Webex.init({
config: {
credentials: {
authorizationString: `<AUTHORIZATION URL FROM DEVELOPER PORTAL>`
}
}
});
Create a new Webex instance configured for a Bot
const webex = Webex.init({
config: {
credentials: `<BOT TOKEN FROM DEVELOPER PORTAL>`
}
});
Browser support for OAuth2. Automatically parses the URL hash for an access token
Alias of AuthorizationBrowser#isAuthorizing
Type: boolean
Kicks off the Authorization Code grant flow. Typically called via AuthorizationBrowser#initiateLogin
(Object)
Promise
:
Kicks off the Implicit Code grant flow. Typically called via AuthorizationBrowser#initiateLogin
(Object)
Promise
:
Requests a Webex Teams access token for a user already authenticated into your product.
Note: You'll need to supply a jwtRefreshCallback of the form
Promise<jwt> = jwtRefreshCallback(webex)
for automatic token refresh to
work.
Promise
:
Called by WebexCore#logout(). Redirects to the logout page
Promise
:
NodeJS support for OAuth2
Alias of AuthorizationNode#isAuthorizing
Type: boolean
Specifies the facingMode to be used by Phone#dial and Call#answer when no constraint is specified. Does not apply if
user
and environment
. For any other values,
you must provide your own constrains or MediaStreamType: string
indicates whether or not the client is registered with the Webex Teams cloud
Type: Boolean
Create a MediaStream to be used for video preview.
Note: You must explicitly pass the resultant stream to Call#answer() or Phone#dial()
((Object | MediaStreamConstraints)
= {}
)
Name | Description |
---|---|
options.constraints MediaStreamConstraints
|
Promise<MediaStream>
:
Place a call to the specified dialString. A dial string may be an email
address or sip uri.
If you set config.phone.enableExperimentalGroupCallingSupport to
true
, the dialString may also be a room id.
(string)
(Object)
Name | Description |
---|---|
options.constraints MediaStreamConstraints
|
|
options.localMediaStream MediaStream
|
if no stream is specified, a new one will be created based on options.constraints |
Call
:
Incoming Call Event
Emitted when a call begins and when Phone#register is invoked and there are active calls.
Type: Object
(Call)
: The incoming call
Type: Object
(number?)
(number?)
(boolean?)
: Group
calling support should work, but necessarily introduces some breaking changes
to the API. In order to get feedback, we're keeping the API unchanged by
default and requiring folks to opt-in to these breakages. As these changes
evolve, you may see some breaking changes that don't necessarily follow
semantic versioning. When we're ready to drop the "experimental" moniker,
we'll release an official SemVer Major bump.
{
audioBandwidthLimit: 64000,
videoBandwidthLimit: 1000000,
enableExperimentalGroupCallingSupport: false,
hangupIfLastActive: {
call: true,
meeting: false
}
}
Type: Object
(boolean?)
: Indicates if a call (i.e. two-party
audio-video experience) should be ended automatically if the current user is
the last active member of the experience.
(boolean?)
: Indicates if a meeting (i.e.
multi-party audio-video experience) should be ended automatically if the
current user is the last active member of the experience
Indicates if the other party in the call has turned off their microphone.
undefined
for multiparty calls
Type: boolean
Indicates if the other party in the call has turned off their camera.
undefined
for multiparty calls
Type: boolean
Returns the local MediaStream for the call. May initially be null
between the time @{Phone#dial is invoked and the media stream is
acquired if Phone#dial is invoked without a localMediaStream
option.
This property can also be set mid-call in which case the streams sent to the remote party are replaced by this stream. On success, the Call's localMediaStream:change event fires, notifying any listeners that we are now sending media from a new source.
Type: MediaStream
The other participant in a two-party call. undefined
for multiparty
calls
Type: CallMembership
The initiating participant in a two-party call.
Type: CallMembership
active - At least one person (not necessarily this user) is
participating in the call
inactive - No one is participating in the call
initializing - reserved for future use
terminating - reserved for future use
Only defined if
PhoneConfig.enableExperimentalGroupCallingSupport has been
enabled
Type: string
initiated - Offer was sent to remote party but they have not yet
accepted
ringing - Remote party has acknowledged the call
connected - At least one party is still on the call
disconnected - All parties have dropped
replaced - In (hopefully) rare cases, the underlying data backing
a Call instance may change in such a way that further interaction with
that Call is handled by a different instance. In such cases, the first
Call's status, will transition to replaced
, which is almost the same
state as disconnected
. Generally speaking, such a transition should not
happen for a Call instance that is actively sending/receiving media.
Type: string
The host of the call Only defined if PhoneConfig.enableExperimentalGroupCallingSupport has been enabled
Type: object
The room id of the call Only defined if PhoneConfig.enableExperimentalGroupCallingSupport has been enabled
Type: object
Access to the remote party’s MediaStream
.
Type: MediaStream
Access to the local party’s screen share MediaStream
.
Type: MediaStream
Alias of Call#reject
Promise
:
Returns a Readable that emits Call#media.pc's RTCStatsReport every second.
StatsStream
:
Returns a StatsStream piped through a StatsFilter
Readable
:
Sends feedback about the call to the Webex Teams cloud
(FeedbackObject)
Promise
:
only emitted if enableExperimentalGroupCallingSupport is enabled
only emitted if enableExperimentalGroupCallingSupport is enabled
only emitted if enableExperimentalGroupCallingSupport is enabled
only emitted if enableExperimentalGroupCallingSupport is enabled
This replaces the Call.ringing event, but note that it's subtly different. Call.ringing is emitted when the remote party calls Call#acknowledge() whereas Call.membership:notified emits shortly after (but as a direct result of) locally calling Phone#dial()
Type: CallMembership
Type: CallMembership
Type: CallMembership
Type: CallMembership
Type: CallMembership
Type: CallMembership
Emitted when a new CallMembership is added to Call#memberships. Note that CallMembership#state still needs to be read to determine if the instance represents someone actively participating the call.
Emitted when a CallMembership is removed from Call#memberships.
Indicates the member's relationship with the call. One of
Type: string
Polls an RTCPeerConnection once per second and emits its RTCStatsReport
Extends Readable
(RTCPeerConnection)
Polls an RTCPeerConnection once per second and emits its RTCStatsReport RTCStatsReport
Extends Readable
(Object
= {}
)
Reforms the interesting data from an RTCStatsReport to a new format
Extends Transform
Reforms the interesting data from an RTCStatsReport into something grokkable
Extends Transform
Maintain a cache of meetings and sync with services.
Extends WebexPlugin
(...any)
gets the reachability instance for Meetings
Reachability
:
gets the personal meeting room instance, for saved PMR values for this user
PersonalMeetingRoom
:
Get all meetings.
Object
:
All active and scheduled meetings.
Get all scheduled meetings.
Object
:
All scheduled meetings.
Get the Stats Analyzer singleton
StatsAnalyzer
:
Get the Stats Calculator singleton
StatsCalculator
:
The PersonalMeetingRoom object to interact with server
Type: Object
If the meetings plugin has been registered and listening via Meetings#register
Type: Boolean
The property name for what collection will be stored, i.e., this.meetingInfos, this.meetings, etc.
Type: String
Meetings Ready Event Emitted when the meetings instance on webex is ready
Meeting Added Event Emitted when a meeting was added to the cache of meetings
Type: Object
Meeting Removed Event Emitted when a meeting was removed from the cache of meetings
Type: Object
Meetings Registered Event Emitted when the meetings instance has been registered and listening
These are the resources provided by Webex instances for interacting with our developer API
These are the resources provided by Webex instances for interacting with our developer API
Memberships represent a person's relationship to a room. Use this API to list members of any room that you're in or create memberships to invite someone to a room. Memberships can also be updated to make someone a moderator or deleted to remove them from the room.
Register to listen for incoming membership events
This is an alternate approach to registering for membership webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.memberships.listen()
.then(() => {
console.log('listening to membership events');
webex.memberships.on('created', (event) => {
console.log(`Got a membership:created event:\n${event}`);
}
webex.memberships.on('updated', (event) => {
console.log(`Got a membership:updated event:\n${event}`);
}
webex.memberships.on('seen', (event) => {
// This represents a "read receipt" and will include a
// lastSeenId for the message this member has just "read",
// There is currently no equivelent webhook for this event.
console.log(`Got a membership:seen event:\n${event}`);
}
webex.memberships.on('deleted', (event) => => {
console.log(`Got a membership:created event:\n${event}`);
}
})
.catch((e) => console.error(`Unable to register for membership events: ${e}`));
// App logic goes here...
// Later when it is time to clean up
webex.memberships.stopListening();
webex.memberships.off('created');
webex.memberships.off('updated');
webex.memberships.off('seen');
webex.memberships.off('deleted');
Adds a person to a room. The person can be added by ID (personId
) or by
Email Address (personEmail
). The person can be optionally added to the room
as a moderator.
(MembershipObject)
Promise<MembershipObject>
:
webex.rooms.create({title: 'Create Membership Example'})
.then(function(room) {
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(membership) {
var assert = require('assert');
assert(membership.id);
assert(membership.roomId);
assert(membership.personId);
assert(membership.personEmail);
assert('isModerator' in membership);
assert('isMonitor' in membership);
assert(membership.created);
return 'success';
});
// => success
Returns a single membership.
((MembershipObject | uuid))
Promise<MembershipObject>
:
var membership;
webex.rooms.create({title: 'Get Membership Example'})
.then(function(room) {
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(m) {
membership = m;
return webex.memberships.get(m.id);
})
.then(function(m) {
var assert = require('assert');
assert.deepEqual(m, membership);
return 'success';
});
// => success
Returns a list of memberships. In most cases the results will only contain rooms that the authentiated user is a member of. You can filter the results by room to list people in a room or by person to find rooms that a specific person is a member of.
Promise<Page<MembershipObject>>
:
var room;
webex.rooms.create({title: 'List Membership Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function() {
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
var assert = require('assert');
assert.equal(memberships.length, 2);
for (var i = 0; i < memberships.length; i+= 1) {
assert.equal(memberships.items[i].roomId, room.id);
}
return 'success';
});
// => success
Returns a list of memberships with details about the lastSeenId for each user, allowing a client to indicate "read status" in a space GUI
This differs from the memberships.list() function in the following ways: -- it accepts only a room or object with a valid roomId -- no other options, eg: max, are considered -- results are not paginated -- memberships in the return do not include the "created", "isRoomHidden", fields -- memberships in the return do include the new "lastSeenId", and "lastSeenDate" fields these will not exist if the member has never "seen" the space
In general this function should be used only when the client needs to access read status info.
This function may be deprecated when this info is provided in the membership objects returned in the list function.
Promise<MembershipObjectList>
:
Deletes a single membership.
((MembershipObject | uuid))
Promise
:
var membership, room;
webex.rooms.create({title: 'Remove Membership Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(m) {
membership = m;
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
var assert = require('assert');
assert.equal(memberships.length, 2);
return webex.memberships.remove(membership);
})
.then(function() {
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
var assert = require('assert');
assert.equal(memberships.length, 1);
return 'success';
});
// => success
Used to update a single membership's properties
((MembershipObject | uuid))
Promise<MembershipObject>
:
var membership, room;
webex.rooms.create({title: 'Memberships Example'})
.then(function(r) {
room = r;
return webex.memberships.list({roomId: room.id});
})
.then(function(memberships) {
membership = memberships.items[0];
var assert = require('assert');
assert.equal(membership.isModerator, false);
membership.isModerator = true;
return webex.memberships.update(membership);
})
.then(function() {
return webex.memberships.get(membership.id);
})
.then(function(membership) {
var assert = require('assert');
assert.equal(membership.isModerator, true);
return 'success';
});
// => success
Updates the lastSeenId attribute of a membership. Call this method to send a "read receipt" for a given message. This will update the lastSeenId for the user's membership in space where the message is.
(string)
Promise<MembershipObject>
:
Messages are how people communicate in rooms. Each message timestamped and represented in Webex as a distinct block of content. Messages can contain plain text and a single file attachment. See the Message Attachments Guide for a list of supported media types.
Register to listen for incoming messages events
This is an alternate approach to registering for messages webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
The messages.listen() event objects can also include additional fields not
available in the webhook's JSON payload: text
, markdown
, and files
.
These fields are available when their details are included in the web socket's
activity
object. Retrieving other fields, such as the html
field,
will require a manual request to get the corresponding message object.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.messages.listen()
.then(() => {
console.log('listening to message events');
webex.messages.on('created', (event) => console.log(`Got a message:created event:\n${event}`);
webex.messages.on('deleted', (event) => console.log(`Got a message:deleted event:\n${event}`);
})
.catch((e) => console.error(`Unable to register for message events: ${e}`));
// Some app logic...
// WHen it is time to cleanup
webex.messages.stopListening();
webex.messages.off('created');
webex.messages.off('deleted');
Post a new message and/or media content into a room.
(MessageObject)
Promise<MessageObject>
:
webex.rooms.create({title: 'Create Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(message) {
var assert = require('assert');
assert(message.id);
assert(message.personId);
assert(message.personEmail);
assert(message.roomId);
assert(message.created);
return 'success';
});
// => success
Returns a single message.
((RoomObject | string))
Promise<MessageObject>
:
var message;
webex.rooms.create({title: 'Get Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message = m;
return webex.messages.get(message.id);
})
.then(function(message2) {
var assert = require('assert');
assert.deepEqual(message2, message);
return 'success';
});
// => success
Returns a list of messages. In most cases the results will only contain messages posted in rooms that the authentiated user is a member of.
Promise<Page<MessageObject>>
:
var message1, message2, room;
webex.rooms.create({title: 'List Messages Example'})
.then(function(r) {
room = r;
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message1 = m;
return webex.messages.create({
text: 'How are you?',
roomId: room.id
});
})
.then(function(m) {
message2 = m;
return webex.messages.list({roomId: room.id});
})
.then(function(messages) {
var assert = require('assert');
assert.equal(messages.length, 2);
assert.equal(messages.items[0].id, message2.id);
assert.equal(messages.items[1].id, message1.id);
return 'success';
});
// => success
Deletes a single message. Deleting a message will notify all members of the room that the authenticated user deleted the message. Generally, users can only delete their own messages except for the case of Moderated Rooms and Org Administrators.
((MessageObject | uuid))
Promise
:
}
var message1, room;
webex.rooms.create({title: 'Messages Example'})
.then(function(r) {
room = r;
return webex.messages.create({
text: 'Howdy!',
roomId: room.id
});
})
.then(function(m) {
message1 = m;
return webex.messages.create({
text: 'How are you?',
roomId: room.id
});
})
.then(function() {
return webex.messages.remove(message1);
})
.then(function() {
return webex.messages.list({roomId: room.id});
})
.then(function(messages) {
var assert = require('assert');
assert.equal(messages.items.length, 1);
assert(messages.items[0].id !== message1.id);
return 'success';
});
// => success
Returns a single person by ID
((PersonObject | uuid | string))
Promise<PersonObject>
:
webex.rooms.create({title: 'Get Person Example'})
.then(function(room) {
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(membership) {
return webex.people.get(membership.personId);
})
.then(function(alice) {
var assert = require('assert');
assert(alice.id);
assert(Array.isArray(alice.emails));
assert.equal(alice.emails.filter(function(email) {
return email === 'alice@example.com';
}).length, 1);
assert(alice.displayName);
assert(alice.created);
return 'success';
});
// => success
Returns a list of people
Name | Description |
---|---|
options.email email
|
Returns people with an email that contains this string |
options.displayName string
|
Returns people with a name that contains this string |
(bool)
optional flag that requires Hydra to send every type field,
even if the type is not "person" (e.g.: SX10, webhook_intergation, etc.)
Promise<Page<PersonObject>>
:
var room;
webex.rooms.create({title: 'List People Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function() {
return webex.memberships.create({
personEmail: 'bob@example.com',
roomId: room.id
});
})
.then(function() {
return webex.people.list({email: 'alice@example.com'});
})
.then(function(people) {
var assert = require('assert');
assert.equal(people.length, 1);
var person = people.items[0];
assert(person.id);
assert(Array.isArray(person.emails));
assert(person.displayName);
assert(person.created);
return 'success';
});
// => success
Example usage of array method
var room;
var aliceId;
var bobId;
webex.rooms.create({title: 'List People Array Example'})
.then(function(r) {
room = r;
return webex.memberships.create({
personEmail: 'alice@example.com',
roomId: room.id
});
})
.then(function(membership) {
aliceId = membership.personId;
})
.then(function() {
return webex.memberships.create({
personEmail: 'bob@example.com',
roomId: room.id
});
})
.then(function(membership) {
bobId = membership.personId;
})
.then(function() {
return webex.people.list([aliceId, bobId]);
})
.then(function(people) {
var assert = require('assert');
assert.equal(people.length, 2);
var person = people.items[0];
assert(person.id);
assert(Array.isArray(person.emails));
assert(person.displayName);
assert(person.created);
return 'success';
});
// => success
Rooms are virtual meeting places for getting stuff done. This resource represents the room itself. Check out the Memberships API to learn how to add and remove people from rooms and the Messages API for posting and managing content.
Register to listen for incoming rooms events
This is an alternate approach to registering for rooms webhooks.
The events passed to any registered handlers will be similar to the webhook JSON,
but will omit webhook specific fields such as name, secret, url, etc.
To utilize the listen()
method, the authorization token used
will need to have spark:all
and spark:kms
scopes enabled.
Note that by configuring your application to enable or disable spark:all
via its configuration page will also enable or disable spark:kms
.
See the Sample App
for more details.
Promise
:
webex.rooms.listen()
.then(() => {
console.log('listening to room events');
webex.rooms.on('created', (event) => console.log(`Got a room:created event:\n${event}`);
webex.rooms.on('updated', (event) => console.log(`Got a room:updated event:\n${event}`);
})
.catch((e) => console.error(`Unable to register for room events: ${e}`));
// Some app logic...
// WHen it is time to cleanup
webex.rooms.stopListening();
webex.rooms.off('created');
webex.rooms.off('updated');
Creates a new room. The authenticated user is automatically added as a member of the room. See the Memberships API to learn how to add more people to the room.
(RoomObject)
Promise<RoomObject>
:
webex.rooms.create({title: 'Create Room Example'})
.then(function(room) {
var assert = require('assert')
assert(typeof room.created === 'string');
assert(typeof room.id === 'string');
assert(room.title === 'Create Room Example');
console.log(room.title);
return 'success';
});
// => success
Returns a single room.
((RoomObject | string))
(Object)
Promise<RoomObject>
:
var room;
webex.rooms.create({title: 'Get Room Example'})
.then(function(r) {
room = r
return webex.rooms.get(room.id)
})
.then(function(r) {
var assert = require('assert');
assert.deepEqual(r, room);
return 'success';
});
// => success
Returns a list of rooms. In most cases the results will only contain rooms that the authentiated user is a member of.
Promise<Page<RoomObject>>
:
var createdRooms;
Promise.all([
webex.rooms.create({title: 'List Rooms Example 1'}),
webex.rooms.create({title: 'List Rooms Example 2'}),
webex.rooms.create({title: 'List Rooms Example 3'})
])
.then(function(r) {
createdRooms = r;
return webex.rooms.list({max: 3})
.then(function(rooms) {
var assert = require('assert');
assert(rooms.length === 3);
for (var i = 0; i < rooms.items.length; i+= 1) {
assert(createdRooms.filter(function(room) {
return room.id === rooms.items[i].id;
}).length === 1);
}
return 'success';
});
});
// => success
Returns a list of rooms with details about the data of the last actvity in the room, and the date of the users last presences in the room. The list is sorted with this with most recent activity first
For rooms where lastActivityDate > lastSeenDate the space can be considerd to be "unread"
This differs from the rooms.list() function in the following ways: -- when called with no parameters it returns an array of all spaces, up to 1000, that the user is a member of -- pagination is not supported. ALL rooms are returned which can result in a large payload -- For users with hundreds of spaces, this API can take some time to to return, for this reason it supports an optional maxRecent parameter. If set this will return only the specified number of spaces with activity in the last two weeks. Reccomended value is 30. Max supported is 100. -- only "id", "type", "lastActivityDate", and "lastSeenDate" are guaranteed to be available for each room in the list -- "title" is usually returned, but not guaranteed
In general this function should be used only when the client needs to access read status info, for example on startup. After startup, clients should track message and membership:seen events to maintain read status client side.
Since this API can take some time to return up to 1000 spaces, it is recommended that custom clients call this first with the maxRecent parameter set to 30, so that they can display some of the more recents spaces. Calling this API a second time with no parameters will return all the spaces.
Not all spaces may be returned, for example when users in more than 1000 spaces, or when a new spaces is added after this function is called, but before it returns. Custom clients should be prepared to gracefully andle cases where an event occurs in a space not returned by this call, by querying rooms.getWithReadStatus() with the id of the room in question
This function may be deprecated when this info is provided in the membership objects returned in the list function.
(int
= 0
)
Promise<RoomInfoObjectList>
:
Returns a single room object with details about the data of the last actvity in the room, and the date of the users last presence in the room.
For rooms where lastActivityDate > lastSeenDate the room can be considerd to be "unread"
This differs from the rooms.get() function in the following ways: -- it takes a single roomId parameter to fetch -- no other options are considered -- only "id", "type", "lastActivityDate", and "lastSeenDate" are guaranteed to be available in the return object -- "title" is usually returned, but not guaranteed
In general clients should use the listWithReadStatus() method on startup to get the initial roomStatus and then update their client side copy by responding to message, membership and room events.
This function allows a custom client to be "nimble" if it is responding to an event with a roomId that was not in the original fetch. The anticipated behavior is that getWithReadStats is called "just in time", with the resulting room object being added to the list of cached room objects on the client side.
This function may be deprecated when this info is provided in the room object returned in the get function.
(string)
Promise<RoomInfoObject>
:
Deletes a single room.
((RoomObject | string))
Promise
:
var room;
webex.rooms.create({title: 'Remove Room Example'})
.then(function(r) {
room = r;
return webex.rooms.remove(room.id);
})
.then(function() {
return webex.rooms.get(room.id);
})
.then(function() {
var assert = require('assert');
assert(false, 'the previous get should have failed');
})
.catch(function(reason) {
var assert = require('assert');
assert.equal(reason.statusCode, 404);
return 'success'
});
// => success
Used to update a single room's properties.
(RoomObject)
Promise<RoomObject>
:
var room;
webex.rooms.update({title: 'Update Room Example'})
.then(function(r) {
room = r;
room.title = 'Update Room Example (Updated Title)';
return webex.rooms.update(room);
})
.then(function() {
return webex.rooms.get(room.id);
})
.then(function(room) {
var assert = require('assert');
assert.equal(room.title, 'Update Room Example (Updated Title)');
return 'success';
});
// => success
Create a new team.
(TeamObject)
Promise<TeamObject>
:
webex.teams.create({name: 'Create Team Example'})
.then(function(team) {
var assert = require('assert');
assert(team.id);
assert(team.name);
assert(team.created);
return 'success';
});
// => success
Returns a single team
((TeamObject | string))
(Object)
Promise<TeamObject>
:
var team;
webex.teams.create({name: 'Get Team Example'})
.then(function(r) {
team = r;
return webex.teams.get(team.id);
})
.then(function(team2) {
var assert = require('assert');
assert.equal(team2.id, team.id);
return 'success';
});
// => success
List teams.
Promise<Page<TeamObject>>
:
var createdRooms;
Promise.all([
webex.teams.create({name: 'List Teams Example 1'}),
webex.teams.create({name: 'List Teams Example 2'}),
webex.teams.create({name: 'List Teams Example 3'})
])
.then(function(r) {
createdRooms = r;
return webex.teams.list({max: 3});
})
.then(function(teams) {
var assert = require('assert');
assert(teams.length === 3);
for (var i = 0; i < teams.items.length; i+= 1) {
assert(createdRooms.filter(function(room) {
return room.id === teams.items[i].id;
}).length === 1);
}
return 'success';
});
// => success
Update a team.
(TeamObject)
Promise<TeamObject>
:
var teams;
webex.teams.create({name: 'Update Team Example'})
.then(function(r) {
teams = r;
teams.name = 'Teams Example (Updated Title)';
return webex.teams.update(teams);
})
.then(function() {
return webex.teams.get(teams.id);
})
.then(function(teams) {
var assert = require('assert');
assert.equal(teams.name, 'Teams Example (Updated Title)');
return 'success';
});
// => success
Team Memberships represent a person's relationship to a team. Use this API to list members of any team that you're in or create memberships to invite someone to a team. Team memberships can also be updated to make someome a moderator or deleted to remove them from the team.
Just like in the Webex app, you must be a member of the team in order to list its memberships or invite people.
Add someone to a team by Person ID or email address; optionally making them a moderator.
(TeamMembershipObject)
Promise<TeamMembershipObject>
:
webex.teams.create({name: 'Create Team Membership Example'})
.then(function(team) {
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function(membership) {
var assert = require('assert');
assert(membership.id);
assert(membership.teamId);
assert(membership.personId);
assert(membership.personEmail);
assert('isModerator' in membership);
assert(membership.created);
return 'success';
});
// => success
Get details for a membership by ID.
((TeamMembershipObject | string))
Promise<TeamMembershipObject>
:
var membership;
webex.teams.create({name: 'Get Team Memberships Example'})
.then(function(team) {
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function(m) {
membership = m;
return webex.teamMemberships.get(m.id);
})
.then(function(m) {
var assert = require('assert');
assert.deepEqual(m, membership);
return 'success';
});
// => success
Lists all team memberships. By default, lists memberships for teams to which the authenticated user belongs.
[type]
:
var team;
webex.teams.create({name: 'List Team Memberships Example'})
.then(function(t) {
team = t;
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function() {
return webex.teamMemberships.list({teamId: team.id});
})
.then(function(teamMemberships) {
var assert = require('assert');
assert.equal(teamMemberships.length, 2);
for (var i = 0; i < teamMemberships.length; i+= 1) {
assert.equal(teamMemberships.items[i].teamId, team.id);
}
return 'success';
});
// => success
Deletes a membership by ID.
((TeamMembershipObject | string))
Promise
:
var membership, team;
webex.teams.create({name: 'Remove Team Memberships Example'})
.then(function(t) {
team = t;
return webex.teamMemberships.create({
personEmail: 'alice@example.com',
teamId: team.id
});
})
.then(function(m) {
membership = m;
return webex.teamMemberships.list({teamId: team.id});
})
.then(function(teamMemberships) {
var assert = require('assert');
assert.equal(teamMemberships.length, 2);
return webex.teamMemberships.remove(membership);
})
.then(function() {
return webex.teamMemberships.list({teamId: team.id});
})
.then(function(teamMemberships) {
var assert = require('assert');
assert.equal(teamMemberships.length, 1);
return 'success';
});
// => success
Updates properties for a membership.
(TeamMembershipObject)
Promise<TeamMembershipObject>
:
Webhooks allow your app to be notified via HTTP when a specific event occurs on Webex. For example, your app can register a webhook to be notified when a new message is posted into a specific room.
Posts a webhook.
(WebhookObject)
Promise<Webhook>
:
webex.rooms.create({title: 'Create Webhook Example'})
.then(function(room) {
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(webhook) {
var assert = require('assert');
assert(webhook.id);
assert(webhook.resource);
assert(webhook.event);
assert(webhook.filter);
assert(webhook.targetUrl);
assert(webhook.name);
return 'success';
});
// => success
Shows details for a webhook.
((Webhook | string))
Promise<Webhook>
:
var webhook;
webex.rooms.create({title: 'Get Webhook Example'})
.then(function(room) {
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
return webex.webhooks.get(webhook.id);
})
.then(function(webhook2) {
var assert = require('assert');
assert.deepEqual(webhook2, webhook);
return 'success';
});
// => success
Lists all webhooks.
(Object)
Name | Description |
---|---|
options.max integer
|
Limit the maximum number of webhooks in the response. |
Promise<Array<Webhook>>
:
var room, webhook;
webex.rooms.create({title: 'List Webhooks Example'})
.then(function(r) {
room = r;
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
return webex.webhooks.list();
})
.then(function(webhooks) {
var assert = require('assert');
assert.equal(webhooks.items.filter(function(w) {
return w.id === webhook.id;
}).length, 1);
return 'success';
});
// => success
Delete a webhook.
((Webhook | string))
Promise
:
var room, webhook;
webex.rooms.create({title: 'Remove Webhook Example'})
.then(function(r) {
room = r;
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
return webex.webhooks.remove(webhook);
})
.then(function() {
return webex.webhooks.list();
})
.then(function(webhooks) {
var assert = require('assert');
assert.equal(webhooks.items.filter(function(w) {
return w.id === webhook.id;
}).length, 0);
return 'success';
});
// => success
Update a webhook.
(Webhook)
Promise<Webhook>
:
var webhook;
webex.rooms.create({title: 'Webhook Example'})
.then(function(room) {
return webex.webhooks.create({
resource: 'messages',
event: 'created',
filter: 'roomId=' + room.id,
targetUrl: 'https://example.com/webhook',
name: 'Test Webhook'
});
})
.then(function(w) {
webhook = w;
webhook.targetUrl = 'https://example.com/webhook/newtarget';
return webex.webhooks.update(webhook);
})
.then(function() {
return webex.webhooks.get(webhook);
})
.then(function(webhook) {
var assert = require('assert');
assert.equal(webhook.targetUrl, 'https://example.com/webhook/newtarget');
return 'success';
});
// => success
Type: Object
(string?)
: Maximum log level that
should be printed to the console. One of
silent|error|warn|log|info|debug|trace
(number?)
: Maximum number of entries to store in the log buffer.
{
level: process.env.LOGGER_LEVEL,
historyLength: 1000
}
The following typedefs describes the responses of the various API calls.
The following typedefs describes the responses of the various API calls.
Payload for Call#sendFeedback
Type: Object
(number)
: Number between 1 and 5 (5 being best) to let
the user score the call
(string)
: Freeform feedback from the user about the
call
(Boolean)
: set to true to submit client logs to the
Webex Teams cloud. Note: at this time, all logs, not just call logs,
generated by the sdk will be uploaded to the Webex Cloud. Care has been taken
to avoid including PII in these logs, but if you've taken advantage of the
SDK's logger, you should make sure to avoid logging PII as well.
Type: Object
(string)
: Unique identifier for the membership
(string)
: The room ID
(string)
: The person ID
(email)
: The email address of the person / room member
(boolean)
: Indicates whether the specified person should be a room moderator
(boolean)
: Indicates whether the specified member is a room monitor
(isoDate)
: The date and time that this membership was created
Type: Object
(string)
: (server generated) Unique identifier for the message
(string)
: The ID for the author of the messasge
(email)
: The email for the author of the messasge
(string)
: The ID for the room of the message
(string)
: The message posted to the room in plain text
(string)
: The message posted to the room in markdown
(Array<string>)
: The source URL(s) for the message attachment(s).
See the
Message Attachments
Guide for a list of supported media types.
(isoDate)
: (server generated) The date and time that the message was created
Type: Object
Type: Object
(string)
: (server generated) Unique identifier for the room
(string)
: The display name for the room. All room members
will see the title so make it something good
(string)
: (optional) The ID of the team to which the room
belongs
(isoDate)
: (server generated) The date and time that the
room was created
Type: Object
Type: Object
Type: Object
(string)
: (server generated) Unique identifier for the webhook
(string)
: The resource type for the webhook
(string)
: The event type for the webhook
(string)
: The filter that defines the webhook scope
(string)
: The URL that receives POST requests for each event
(string)
: A user-friendly name for this webhook
(string)
: (server generated) The date and time that the webhook was created
An email address, as a string.
Type: string
The date and time, specified in ISO 8601 extended offset date/time
format (e.g. 2015-10-18T14:26:16+00:00
).
Type: string
Type: Object
(string)
: (server generated) Unique identifier for the attachment action
(string)
: The ID of the message in which attachment action is to be performed
(string)
: The type of attachment action eg., submit
(Object)
: The inputs for form fields in attachment message
(string)
: (server generated) The ID for the author of the attachment action
(string)
: (server generated) The ID for the room of the message
(isoDate)
: (server generated) The date and time that the message was created
Post a new attachment action for a message with attachment.
(AttachmentActionObject)
Promise<AttachmentActionObject>
:
webex.rooms.create({title: 'Create Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id,
attachments:[ {
contentType: 'application/vnd.microsoft.card.adaptive',
content: {
type: 'AdaptiveCard',
version: '1.0',
body: [
{
type: 'TextBlock',
text: '',
size: 'large'
},
{
type: 'TextBlock',
text: 'Adaptive Cards',
separation: 'none'
}
{
type: 'Input.Date',
id: 'dueDate'
}
],
actions: [
{
type: 'Action.Submit',
title: 'Due Date'
}
]
}
}]
});
})
.then(function(message) {
return webex.attachmentActions.create({
type: 'submit',
messageId: message.id,
inputs:{
dueDate: '26/06/1995'
}
})
.then(function(attachmentAction)){
var assert = require('assert');
assert(attachmentAction.id);
assert(attachmentAction.type);
assert(attachmentAction.personId);
assert(attachmentAction.inputs);
assert(attachmentAction.messageId);
assert(attachmentAction.roomId);
assert(attachmentAction.created);
return 'success';
}
});
// => success
Returns a single attachment action.
(string)
Promise<AttachmentActionObject>
:
var attachmentAction;
webex.rooms.create({title: 'Get Message Example'})
.then(function(room) {
return webex.messages.create({
text: 'Howdy!',
roomId: room.id,
attachments:[ {
contentType: 'application/vnd.microsoft.card.adaptive',
content: {
type: 'AdaptiveCard',
version: '1.0',
body: [
{
type: 'TextBlock',
text: '',
size: 'large'
},
{
type: 'TextBlock',
text: 'Adaptive Cards',
separation: 'none'
},
{
type: 'Input.Date',
id: 'dueDate'
}
],
actions: [
{
type: 'Action.Submit',
title: 'Due Date'
}
]
}
}]
});
})
.then(function(message) {
return webex.attachmentActions.create({
type: 'submit',
messageId: message.id,
inputs:{
dueDate: '26/06/1995'
});
})
.then(function(attachmentAction) {
return webex.attachmentActions.get(attachmentAction.id)
})
.then(function(attachmentAction){
var assert = require('assert');
assert.deepEqual(attachmentAction, attachmentAction);
return 'success';
})
// => success
Gets a list of all recent devices associated with the user the device list gets populated from Redis
Promise<Device>
:
Gets a list of all recent devices associated with the user the device list gets populated from Redis
Promise<Device>
:
Search for a device by name
Promise<Device>
:
Caches the device info and also registers to Redis for subsequent fetches
deviceInfo
:
Retreives device info of a particular device
(string)
Promise<deviceInfo>
:
Unregisters the device from Redis, will not fetch in subsequent loads, similar to space.deleteBinding()
(string)
Promise<deviceInfo>
:
Requests to display PIN on the device
Promise<deviceInfo>
:
pairs the device with the user (manual pairing), also adds it to user's recents list for subsequent fetches. similar to space.join()
Promise<deviceInfo>
:
unpairs the device with the user (manual/ultrasonic pairing), but still keeps in the recents list/does not remove from Redis options.removeAllDevices will remove all associated devices to user similar to space.leave()
Promise<deviceInfo>
:
binds the space to the paired device (if supported) similar to space.bindConversation()
Promise<deviceInfo>
:
unbinds the space to the paired device (if supported) similar to space.unbindConversation()
Promise<deviceInfo>
:
Gets the audio state of the paired device similar to device.getAudioState()
Promise<audioState>
:
Updates audio state of the paired device, should be called every 10 minutes or when mic or volume state is changed similar to device.putAudioState()
Promise<audioState>
:
Mutes paired device similar to device.mute()
Promise<audioState>
:
Unmutes paired device similar to device.unmute()
Promise<audioState>
:
Increases paired device's volume similar to device.increaseVolume()
Promise<audioState>
:
Decreases paired device's volume similar to device.decreaseVolume()
Promise<audioState>
:
Sets paired device's volume but should use increase and decrease api instead similar to device.setVolume()
(number
= 0
)
Promise<audioState>
:
Utility function to update decrypted device name on device object
(Array
= []
)
device
:
Utility function to update decrypted device name on device object
(object
= {}
)
device
:
Utility function to update device info on mercury updates
(object)
device
:
Metrics handles all the call metrics events
Docs for Call analyzer metrics https://sqbu-github.cisco.com/WebExSquared/call-analyzer/wiki https://sqbu-github.cisco.com/WebExSquared/event-dictionary/blob/master/diagnostic-events.raml
(any)
(any)
(any)
Hey there. Glad you found your way here. Please be sure to alphabetize your constants.
Type: string
null
:
(String)
ID of the meeting info you wish to retreive
MeetingInfo
:
returns a meeting info instance
(Object)
with format of {type: String, desintation: String}
where type is PERSONAL_ROOM, SIP_URI, CONVERSATION_URL, and destination is userId, sipUri, convoUrl respectively
type can also be specified as an option and be of the list SIP_URI,MEETING_ID,LOCUS_ID,PERSONAL_ROOM,MEETING_LINK,ONE_ON_ONE,MEDIA_SIP_URI,CONVERSATION_URL,TEMP_SIP_URI
with the desination matching
Promise
:
returns a promise that resolves/rejects the result of the request
(Object)
with format of {type: String, desintation: String}
where type is PERSONAL_ROOM, SIP_URI, CONVERSATION_URL, and destination is userId, sipUri, convoUrl respectively
type can also be specified as an option and be of the list SIP_URI,MEETING_ID,LOCUS_ID,PERSONAL_ROOM,MEETING_LINK,ONE_ON_ONE,MEDIA_SIP_URI,CONVERSATION_URL,TEMP_SIP_URI
with the desination matching
Promise
:
returns a promise that resolves/rejects the result of the request
Helper function to check if a string matches a known meeting link pattern
(String)
string to parse and see if it matches a meeting link
Boolean
:
Helper function to build up a correct locus url depending on the value passed
(String)
One of
[SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
(Object)
?? value.value
Object
:
returns an object with {resource, method}
AudioVideo
Type: Object
SharePreferences
Type: Object
JoinOptions
Type: Object
SendOptions
Type: Object
SendOptions
Type: Object
(Object)
Meeting is the crux of the plugin
Reference to the stats builder object
WebRTCStats
:
write the stats builder object and assign to meeting property
(Object
= {}
)
WebRTCStats
:
Shorthand function to join AND set up media
(Object
= {}
)
options to join with media
Name | Description |
---|---|
options.joinOptions JoinOptions?
|
see #join() |
options.mediaSettings MediaDirection
|
see #addMedia() |
options.audioVideoOptions AudioVideo?
|
see #getMediaStreams() |
Promise
:
-- {join: see join(), media: see addMedia(), local: see getMediaStreams()}
joinWithMedia({
joinOptions: {resourceId: 'resourceId' },
mediaSettings: {
sendAudio: true,
sendVideo: true,
sendShare: false,
receiveVideo:true,
receiveAudio: true,
receiveShare: true
}
audioVideoOptions: {
audio: 'audioDeviceId',
video: 'videoDeviceId'
}})
Get local media streams based on options passed
(MediaDirection)
A configurable options object for joining a meeting
(AudioVideo?
= {}
)
audio/video object to set audioinput and videoinput devices, see #Media.getUserMedia
(SharePreferences?)
audio/video object to set audioinput and videoinput devices, see #Media.getUserMedia
Promise
:
see #Media.getUserMedia
Specify joining via audio (option: pstn), video, screenshare
(Object
= {}
)
A configurable options object for joining a meeting
Name | Description |
---|---|
options.resourceId Object
|
pass the deviceId |
options.mediaSettings MediaDirection
|
pass media options |
options.localStream MediaStream
|
|
options.localShare MediaStream
|
Promise
:
A confluence of updateAudio, updateVideo, and updateShare this function re-establishes all of the media streams with new options
(Object
= {}
)
Name | Description |
---|---|
options.localStream MediaStream
|
|
options.localShare MediaStream
|
|
options.mediaSettings MediaDirection
|
Promise
:
Update the main audio streams with new parameters
(MediaStream?)
Promise
:
Update the main video streams with new parameters
(MediaStream?)
Promise
:
Update the share streams, can be used to start sharing
(MediaStream?)
Promise
:
created later
Type: AudioStateMachine
created later
Type: VideoStateMachine
Type: MeetingStateMachine
Passing only info as we send basic info for meeting added event
Type: MediaProperties
Type: InMeetingActions
Meeting Ringing Event Emitted when this client should play a ringing sound, because this member is getting an incoming meeting or sending out an incoming meeting
Type: Object
Meeting Stopped Sharing Local Event Emitted when this member stops sharing
Type: Object
Meeting Actions Update Event Emitted when a user can take actions on a meeting such as lock, unlock, assign host
Type: Object
Reconnection Starting Event Emitted when reconnection of media to the active meeting was successful
Meeting Started Sharing Local Event Emitted when this member starts sharing
Type: Object
Closes the local stream from the class and emits an event to the developer
undefined
:
MediaDirection
Type: Object
MediaDirection
Type: Object
The meeting instance to execute all state changes on
Specify joining via audio (option: pstn), video, screenshare
(JoinOptions
= {}
)
A configurable options object for joining a meeting
Promise
:
the join response
Roap options
Type: Object
Type: Object
(Roap)
initializes the state machine
StateMachine
:
an instance of a state machine
Method to handle the transitions between states
String
:
new state value
String
:
String
:
returns a new value to set the state to
(Object)
current video data for the transition {mute, self}
String
:
a new state value for the transition
Event that fires after we've transitioned to a new state
(Object)
null
:
(RTCPeerConnection)
(String)
Promise
:
make a browser call to get the media
(SendOptions)
Promise
:
creates peerconnection and attaches streams
(MediaDirection)
(Object)
call flow id
Array
:
[peerConnection, ]
updates all the media streams and creates a new media offer
(MediaDirection)
(String)
Promise
:
creates a new offer
(String)
(RTCPeerConnection)
(RTCRtpTransceiver)
(Object)
see #Media.setTrackOnTransceiver
Promise
:
generates audio and video using constraints (often called after getSupportedDevices)
Object
:
{streams}
Toggle a specific stream noop as of now, does nothing
null
:
Stop input stream
(MediaTrack)
A media stream
null
:
generates streams for audio video and share
(object)
parameter
Name | Description |
---|---|
mediaSetting.sendAudio Object
|
sendAudio: {Boolean} sendAudio constraints |
mediaSetting.sendVideo Object
|
sendVideo: {Boolean} sendVideo constraints |
mediaSetting.sendShare Object
|
sendShare: {Boolean} sendShare constraints |
Array
:
[localStream, shareStream]
Initializes the StateMachine for the meeting
(Meeting)
A reference to a meeting instance
StateMachine
:
Ring stop transition, to end the ring event for the meeting, and transition the state to ANSWERED OR DECLINED, only for outgoing meetings
(Object)
-- FiniteStateMachine automatically passed, not used
(Object)
-- {remoteAnswered: {Boolean}, remoteDeclined: {Boolean}}
Boolean
:
Ring transition, to cause the ring event for the meeting, and transition the state to RINGING, for both incoming, and outgoing meetings
(Object)
-- FiniteStateMachine automatically passed, not used
(String)
-- incoming call === INCOMING / or other meetings have a ring type of JOIN
Boolean
:
handle the error transition stage
Boolean
:
After ANY transition occurs, we want to know what state the meeting moved to for debugging
(Object)
Boolean
:
(Object)
An object that contains whether we send audio/video/screen streams
(Meeting)
the meeting instance we are using for this state machine
StateMachine
:
returns a StateMachine instance
Convenience method to return whether the call is muted or not
Boolen
:
whether the audio is muted or not
Convenience function to tell whether we are muted or not
Boolen
:
boolean that indicates whether the video is currently muted
Convenience method to expose this.self
Boolen
:
this.self
Convenience function to tell who last muted/unmuted the video
Boolen
:
boolean that indicates whether the video was muted by the end user or server
(Object)
the audio state to change
null
:
null
:
Method that gets fired before the toggle state change. If this fails, return false will cancel the transition and the state will remain unchanged
Object
:
this.data which contains {muted, self}
Method that gets fired before the toggle state change. If this fails, return false will cancel the transition and the state will remain unchanged
Object
:
this.data which contains {muted, self}
Object
:
this.data which contains {muted, self}
Object
:
this.data which contains {muted, self}
(Object)
object containing media direction
Name | Description |
---|---|
mediaDirection.sendVideo Boolean
|
Whether or not to send video in the meeting |
(Meeting)
an instance of a Meeting
Statemachine
:
returns a state machine instance
handles when the locus.host is updated
(Object)
the locus.host property
undefined
:
handles when the locus.mediaShares is updated
(Object)
the locus.mediaShares property
undefined
:
handles when the locus.self is updated
undefined
:
Events plugin-meetings local Used to emit events internally between modules specific to an object
Extends ChildEmitter
parses the relevant values for self: muted, guest, moderator, mediaStatus, state, joinedWith, creator, id
undefined
:
get the id from the self object
(Object)
String
:
get the muted property from the self object
(Object)
Boolean
:
(Object)
Boolean
:
(Object)
Boolean
:
(Object)
Boolean
:
Boolean
:
extract the sipUrl from the partner
Object
:
parse the relevant host values that we care about: id
(Object)
Object
:
parsed host or null if host was undefined
get the previous and current host values parsed, as well as the boolean updates
Object
:
previous: {Object} old host, current: {Object} new host, updates: {isNewHost: {boolean}} boolean update values
determine by id if 2 hosts are different
Boolean
:
Extract the id from the host object
(Object)
String
:
parse the relevant host values that we care about: id
(LocusControls)
Object
:
parsedObject - parsed host or null if host was undefined
String
:
parsedObject.recordingId
Extract the id from the record controls object
(LocusControls)
(String | null)
:
Controls
Type: Object
parses the relevant values for mediaShares: contentId, disposition
(Object)
undefined
:
get the previous and current mediaShares values parsed, as well as the boolean updates
Object
:
previous: {Object} old share, current: {Object} new share,
get the floor disposition (released, granted)
(Object)
Boolean
:
disposition
extract the content property from media shares
(Object)
Object
:
extract the floor property from content object
(Object)
Object
:
extract the content's floor from media shares
(Object)
Object
:
get who is sharing from media shares
(Object)
Object
:
change the content floor grant
(Object)
options for floor grant
Name | Description |
---|---|
options.disposition String
|
floor action (granted/released) |
options.personUrl String
|
personUrl who is requesting floor |
options.deviceUrl String
|
Url of a device |
options.resourceId String
|
Populated if you are paired to a device |
options.uri String
|
floor grant uri |
Promise
:
change the content floor grant
(Object)
options for floor grant
Name | Description |
---|---|
options.disposition String
|
floor action (granted/released) |
options.personUrl String
|
personUrl who is requesting floor |
options.deviceUrl String
|
Url of a device |
options.resourceId String
|
Populated if you are paired to a device |
options.uri String
|
floor grant uri |
Promise
:
Members Content Update Event Emitted when who is sharing changes
Members Update Event Emitted when something in the roster list needs to be updated
Members Self Update Event Emitted when who is the self changes
Members Host Update Event Emitted when who is the host changes
Is this member associated to another user by way of pairing (typical of devices)
Type: String